Thanks to @collimarco, it is indeed a Safari bug. Upgrading to Safari beta (can't upgrade to Sequoia at the time) fixed the issue.