Zend certified PHP/Magento developer

Dell laptop having issues with charging. Recognises charger and starts charging automatically and then doesn’t recoginse charger and won’t charge

I have a 7 year old dell vostro and this issue arose suddenly when one day I noticed that my laptop was lagging significantly. I went to the task manager to see the issue and in the performance tab the CPU was working at only 14%. It was throttled to the point where performance was garbage. The issue was laptop wasn’t charging. I changed the charging port. Replaced the adapter. Installed and reinstalled the drivers. Reinstalled windows. And it won’t recognize the adapter (even the genuine one) at all and refuse to charge. And then one day it automatically was charging, recognizing every adapter including the genuine one. And then again one day it started acting up again. It has been happening ever since at irregular intervals. I have a feeling that this is a software issue. Is there anything that can be done to fix or to know what might be causing the issue?

Edit2: I am using throttlestop as a temporary fix with task scheduler to run it on startup.
Edit: I am on windows 10 latest version. These are the specifications:

Version 22H2
Installed on    ‎8/‎12/‎2023
OS build    19045.3803
Experience  Windows Feature Experience Pack 1000.19053.1000.0