Interesting. I recently upgraded from an iPhone 12 to an iPhone 15 Pro Max.
I had this problem recently with my old iPhone 12, and just assumed that my old iPhone was nearing the end of its useful life (the battery was also not lasting as long as it used to), so a possible ageing hardware issue. I never got to the bottom of this, as I planned to upgrade, which I assumed would cause the slowness issue to disappear.
Not so: the new phone suffered from the same problem, so I came here for advice, and tried every suggestion - all to no avail.
Having exhausted every possibility, I took the problem to an Apple guru in the Genius Bar of my local Apple store. He had not seen this before, and tried all the (to him) obvious tricks to increase the speed without success, then he stripped everything off my phone and completely reinstalled the iOS - which worked properly straightaway. My phone is now operating at maximum possible speed, both on WiFi and data.
We still don’t know what the problem was, but the reinstallation of the OS certainly solved it so it is presumably software-related, especially as it also occurred on my old iPhone 12.