I'm having the same issues with my iPhone 12 Pro lately and similar with my previous iPhone 11 Pro Max. At&t had me reset so much and it come works until I'm connected with my home wifi network or another secured network. Sometimes it connects after a bit of time but then sometimes it take more to get it working all over again. Even with testing various apps, thats when I can tell its not working. I'm weeding through various apps and seeing it any could be causing the problem but taking some time to clean up too.