Oh, also, to more directly answer your question about why your first
netlify.toml file didn’t work, I wonder if you were testing it in a deploy preview?
The following format:
[context.production.environment] HUGO_VERSION = "0.63.2"
applies to production builds only, as described in this section about deploy contexts in Netlify configuration files.
Your newer syntax,
[build.environment] HUGO_VERSION = "0.64.0"
applies to all builds, regardless of context (unless you also specify a different value under a more specific context — like with CSS, specificity wins!)