This app was mentioned in 2 comments, with an average of 1.50 upvotes
I think I found a temporary solution. This app seems to keep my wifi on for me. Kinda sucks that I have to use an app for it and it might drain battery a bit more but as far as I know it seems to work.
Edit: Nvm just had the problem again. Still lost on how to fix it.
Have you tried apps like this? Advanced Wifi Lock