This is yet another regression reported in Debian: Creating a key using a parameter file with the key type set to "default" results in an error message "gpg: key generation failed: Unknown elliptic curve". This works for gpg22, though.
Full test script can be found at https://sources.debian.org/src/gnupg2/2.2.27-2/debian/tests/simple-tests/ (beware, URL is not stable). It boils down to:
cat > key-batch << EOF Key-Type: default Subkey-Type: default Name-Real: test case Name-Email: example@example.com Expire-Date: 0 %no-protection %commit EOF gpg --batch --generate-key key-batch
Tested on current HEAD (a660e1060 aka gnupg-2.3.1-47-ga660e1060).
Changing "Key-Type" to e.g. "RSA" make the operation pass.