It would be hard to answer this question and I would not accept a repair like this.
My thoughts would be that since the Wi-Fi starts working after 5 minutes you could have a cracked or oxidised pad under the Wi-Fi IC. As the phone gets warm the connection comes back. You could try and test this by applying pressure to the Wi-Fi chip. If that fixes the problem you would just need to re-ball it.
It also could be a problem with your SCL or SDA lines. You would need to check all the pullup resistors.
In older models it was easy to replace the Wi-Fi chip but the 7 is more difficult. Sometimes the pads get pulled from the chip so you need to rebuild them, if you cannot you will have to put a new chip on which would mean unbinding the Wi-Fi address from the NAND.