There could be a couple of things that could be causing this.
First things first, did you check the volume limit in the settings of the iPhone? Volume limit settings can affect this and all it takes is to adjust the limit or disable the volume limit on the iPhone.
If that doesn’t work, then have you tried a different pair of headphones? Considering that you are using wired headphones, the cables inside of the headphones may have come loose due to the tugging and pulling on them causing issues with the volume.
Otherwise, I would try to reset the phone if nothing works because that will sometimes fix things, but not all the time. Just be sure that you have a backup of the phone available to restore it. You can also try and clean the port with compressed air or by GENTLY using a WOODEN toothpick while the phone is turned off. I stress this because you can cause damage if you go the toothpick method and possibly shock yourself if you used a toothpick made out a material other than wood.
If you have tried everything then it might be a hardware issue. One thing to note, there are some issues with this iPhone and volume settings. This phone should still be under warranty from Apple so if nothing else works, then you could take it to Apple for diagnostics at least, as diagnostics don’t equal you paying for a repair.