Hi! Does this behavior change when it is strictly on battery power vs AC power? It may be worth testing it on battery power, and then removing the battery and trying it on AC power in order to make a determination.
Generally in my experience I would say problems like this have to do with the DC-in/sound board, which is a module on the left side of the computer containing the power port and other connectors. This board controls most power functions.
If you let me know the model number of your machine, I can find you the iFixit part. It's not the easiest repair, but it's do-able.
Just to make sure it's not other issues, I would also try resetting the PMU and PRAM, as well as reseat the RAM, and test the memory slots by powering on with one slot empty, and then the other.