Hello kiley169,
Is the volume that it's being lowered to the same as what it was last left at when the headphones were previously connected?
You may test that out by connecting the headphones to the device, and setting the volume to a particular level. Then, disconnect the headphones fully for a few moments. Adjust the volume while the headphones are disconnected, and then go ahead and re-connect them. It may go back to the level you had originally set the volume to when they were last connected.
If that hasn't helped then you may also find info on the Reduce Loud Sounds setting here: Use headphone audio level features on iPhone - Apple Support
Reduce loud headphone sounds in Settings
1. Go to Settings
, then tap Sounds & Haptics (iPhone 7 and later) or Sounds (earlier models).
2. Tap Headphone Safety.
3. Turn on Reduce Loud Sounds, then drag the slider.
iPhone analyzes your headphone audio and reduces any sound above the level you set.
Cheers.