I'm pretty certain only variables prefixed with NEXT_PUBLIC_ are swapped out at build time for their corresponding values. Try renaming it to NEXT_PUBLIC_CURRENT_ENV.
NEXT_PUBLIC_
NEXT_PUBLIC_CURRENT_ENV