External ports becoming inactive due to power fluctuations

My manjaro xfce4 setup is showing some weird behaviour with all the ports. If I remove the charger after plugging it in or remove the charger which was plugged in before and after the booting of system then the usb port and lan port stop working. If the system is plugged in or plugged out the whole time then no problem at all but once I plugin and plug out the charger or plugout the already plugged in charger it happens. Plugging in the usb again or even charger again doesn’t solve this issue. I even tried to work my way out by using plasma desktop thinking it was a de problem but I was wrong it happens in plasma and even on tty screen. I think it is some issue with the power management system. Any suggestions to fix the problem is appreciated.