astruckm That's a fair point. In fact, I just checked Safari and it also doesn't allow you to close the certificate popup with esc but does with return.
I am a new user to macOS, having only used WinDOS & Linux for the last ~ 30 years. Is this perhaps a muscle memory from that? Are Mac users more likely to default to hitting the return key to interact with these sorts of windows?
My reflex is always to hit esc. Firstly because of muscle memory but also the left hand is always on the keyboard but the right may not be.