Hi Blaine Garrett,
Thanks for sharing a great writeup about a gnarly topic.
I have a minor correction to share. You wrote:
"Note: This hierarchy optionally goes further with .env.development and .env.production (corresponding to the value of NODE_ENV)..."
But they don't actually correspond to the value of NODE_ENV. Next.JS bases its decision to read from .env.development vs .env.production on one thing only: whether you start the app with next dev or next start. That's all. NODE_ENV's value is irrelevant to that bit of Next-specific logic.
AFAICT you get the rest of the complicated picture right; hopefully my comment will inspire you to edit the post, or at least help ensure other readers aren't accidentally misled.
Slainte, Chris