Dnf warning message after upgrade from Rocky 8 to Rocky 9

Sounds like you still have a gpg key on the system causing issues, you can list them with:

rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n'

then when you find the one that is most likely causing the problems, you can remove it:

dnf remove gpg-pubkey-xxxxx-xxxxx

where xxxxx will be a random number for that particular key. Most likely a third-party repo from Rocky 8. Someone else had similar recently with a Plex repo they had used, on removing the gpg key/signature it worked normally again. You may also have other EL8 keys that are no longer needed and can also be removed.