I have a problem with an app not loading content on WiFi. If I switch to mobile data it works normally. I disabled battery optimization for it, set the WiFi network to be treated as unmetered but with no success. It works whenever it wants. I didn't disable any important system services or apps (chrome, wellbeing, files go, google, lens, moto help, moto notifications). I have a Motorola One. My last phone, LG G6 had no trouble with it, I am using the same router/network. It's misbehaving on both 2.4 GHz and 5 GHz.
Firstly, check the performance of other devices on your same WiFi. Are you getting the intended speed on it? Might be an internet issue at its core.
Secondly, there might be other WiFi from your neighbors that "overlap" with your WiFi and causing the issue. Use an app like this and see which networks are the same channel.
Depending on how overlap, just change the WiFi channel in your router and see if it does the trick or not.