I had the problem there i smacked the phone on my bed and i was hitting my phone without any reason then i found it was a software problem. After knowing it i started searching for a genuine solution but i didn’t find any but after a lot of reaserch i just solved my problem by reboot.
[link|https://okadtech.com/redmi-volume-button-problem-solution/|Redmi volume button problem solution|new_window=true]
Hope this will help you also