I saw many other people encountered this issue. I have tried many of the proposed solutions but in vain. Here is a list of things I did to tackle it:
-Discharge my phone battery to 0% then full charge to 100% with my original battery charger and TYPE C cable.
-Cleared cache and date of USB Settings
-Cleared cache of Android System
-Boot in safe mode and cleared cache of USB settings
-Wiped cache partition in recovery mode
-Downgraded to previous firmware
-Cleaned USB port with a plastic toothpick
-Put the phone 20 hours in rice and even used hair dryer
-Enabled developer mode and change USB default connection to phone charging only
I tried all these but in vain. The issue still persists. I have heard that even after changing the USB port, the problem comes back later. So, it is not a hardware issue then!