Which version of the YubiKey 5 NFC do you have?
There is a legitimate reason why I ask…
I have 4 YubiKeys (2 NFCs, 2 non-NFCs). YubiCo about 6-7 months ago now upgraded the keys to a new version to combat a critical security problem. This hardware change was more than a mere firmware change - this was a complete hardware revision. I have the Nothing Phone 3(a), and I had to replace my NFC versions and they are working just fine. YubiCo support was super nice and sent replacements at no charge to me.
It could be you have the older hardware revision of the key and it might be playing up. If it has been less than a year since your purchase, contact them in regards to the issue and request replacements, that very well might clear up the problem.