USB gives high usb temperature warning after replacement

I have changed the usb as my phone won’t charge now I get the following warning
high usb temperature disconndect usb cable immediately

Have you tried to charge with a different cable? It may be that the cable is defective/broken and the reason the charging port stopped working. It might have for example bent contacts that cause additional resistance. It would heat up the port and cause it to stop working after a while.