Thank you very much!
It turns out, it was the SiteGround Optimizer plugin that was automatically activated when I migrated my site. I only migrated it a few days ago, so I didn’t even think of plugins being the issue. I deactivated it, and now everything works like it’s supposed to.
Thank you again for your help, @jerrysarcastic!