When I updated my iPhone 8 to 12.2 (16E227), it broke the WiFi and now apps like YouTube can't connect and often times I can't even load apple.com in Safari. When I restart the phone then it works for about a minute. When I turn airplane mode on and off, it works for about a minute.
However my iPad with iOS 9.3.5 works flawlessly. My Samsung laptop works flawlessly. Also when I turn WiFi off on my iPhone and use cell data, it also works.