If, in response to a KEYPARAM inquire, the client closes the connection or sends an invalid response (such as ?), the server crashes. The following bash command reproduces the problem on Fedora 35 with GnuPG 2.3.4:
echo KEYPARAM | gpg-agent --server