That's the older syntax. What version of NGinx are you on? Only curious because there have been a few bug fixes.
nginx -v
1.23.1
Here [1] are the summarized release notes that describe the bugs fixed in the latest versions. If you update the http2 flag/syntax changes to what I listed.