Hardcoding Google Tag Manager snippet instead of using the admin setting

We are running a production and staging version of our site and would like to benefit from Google Tag Manager (GTM) environments, so we don’t need to set up two independent containers.

Instead of using the GTM setting (see image below), I was thinking of pasting the modified tag code in admin -> Customize -> CSS / HTML -> <head>, which would allow to add the environment – the current GTM setting doesn’t have this option.

Before going ahead, I was wondering if both ways would be equivalent.
Is there anything I’m missing?