So possibly the last update:
I tried a different filter on this device and it also disconnected from the internet. I also noticed something that irked me where I could block 1 domain from an app and apparently none of the domains would go through anymore even if I whitelisted them, which actually broke a few apps that I use regularly. It turned out to be a bug, but it annoyed me enough to switch back to the old filter.
So seeing as how both filters show a disconnection when idle and resetting network settings didn't do anything, I asked the university IT guy as well. He said that there's actually quite a few students who complain about WiFi disconnections with the most recent complaint being the same morning that I went to him, so he thinks there's a problem with the WiFi certificates or the WiFi DNS. Which means that this device is just going to keep disconnecting. I don't know why this phone does this but my other phone does not.
I also asked a techy friend of mine who looked at the configuration of my DNS filter and couldn't see a problem. He told me to check the configuration of the router itself, which I don't know how to do. But that doesn't matter because I'm not even allowed to turn the thing off and on, so I'm probably going to get into a lot of trouble if I go around messing with the configuration and I don't feel for the hassle. I told him about what the IT guy said and he also thinks that this is a university problem. I also vaguely remember the IT guy saying something about how the university cut corners when they set up their WiFi, so it's not impossible. Which is probably why he's suspecting the WiFi in the first place.
So basically there's nothing wrong with my filter, but there's something wrong with the WiFi and I can guarantee you that it won't be fixed. So this phone will just have to stay like this until I finish my degree and move out so that I can go all out on privacy and self-hosting and whatnot that's not possible right now with the restrictions from living on the university residence. Then I will have to try again...
I will probably try putting my sim in this phone anyway with mobile data always on for messages and see what happens. Although I do wonder if there is a difference in the phone software that's causing this specific device to disconnect when the other does not when this phone actually has less filters, less apps and less things to block. This is very interesting to say the least. But meh, what can I do about it when I have no control over the iffy WiFi? I'll have to revisit this problem in the future once I've moved off the university premises and can afford my own WiFi that I can fiddle with so that I can get actually get to the bottom of this if it happens in the future. But for now... So be it. I have no idea of what more I can do and this seems like something out of my control.
Thank you to everyone who has taken the time to help me! I appreciate all the time and effort, even if it was just to read my messages!