Created attachment 465657 [details] html file for demonstrate behavior event.relatedTarget doesn't set in correctly when blur event occures. Example of that behavior included in attachment index.html file. tested on browserstack 12.1 - 16.3 and in real 16.4
In Chrome 111 and Firefox 110 event.relatedTarget is not null (HTML Button Element in case of attachment)
<rdar://problem/107650876>
This is because button is not mouse focusable by default in Safari.