If the same code works on Windows 10 ,11 but not on Windows Server 2022, with the same exact setup, unfortunately the issue lies within Windows Server 2022. We noticed this report here:
Indicating that patches were breaking browsers but that goes back to January 2024. It's unclear if it has been resolved meanwhile. Unfortunately there is little that we can do from our side.