Sounds to me like a failing system board.
I would first exercise the connections on the system board and see if any of those don’t look right.
Then I would check the battery on the system board.
I would also check to see if there is anything physically wrong with the port to which the power adapter plugs in, as there may be some connection not being made…a quick check is this: plug it in, with the battery in it. if a light comes on indicating the battery is charging, or is charged, then there is nothing wrong with the port and the traces between the input and the battery. Unfortuneately, this doens’t necessarily rule out system board.
Hope this helps!