There might be corrosion on the motherboard near the buttons. Unfortunately, there currently is no guide for this, but you may be able to use another guide to get to the motherboard.
The cable on the power/volume button board may have been damaged, or it disconnected from the motherboard. To change the board or check the cable, refer to this guide. Nintendo Switch 電源と音量ボタンボードの交換