Chosen Solution
I don’t know why my phone is overheating but I’m wondering if I can test if it is the charging port by unplugging the loudspeaker flex while turned on?
You can safely unplug the charging port while nothing is plugged into it, I’ve hot swapped charging ports plenty of times on iPhones.