Check whether the phone case is pressing against or putting pressure on the volume buttons. This can sometimes cause the buttons to behave unexpectedly or become difficult to operate.
Also, if the phone is mounted on a tripod or stand, make sure the holder is not pressing against the volume buttons. Some tripod clamps can grip the phone tightly enough to continuously press a button, especially if the holder is positioned too close to the side controls.
Try removing the case and mounting the iPhone directly in the holder. If the problem disappears, reposition the holder or use a case that provides sufficient clearance around the volume buttons.