I was out in heavy rain for 30 seconds with phone in my pocket and wasn’t aware that it had got damp but that must have been the cause.
Having seen this thread I connected to a Bluetooth device and switched airplane mode on. The volume control then reverted to showing normal volume not headphones. When I turned off both airplane mode and Bluetooth, the volume stayed in normal speaker mode, so all good again.
Whether this was a coincidence that the headphone socket dried out at this point I don’t know. I suspect that allowing the phone to gently dry is probably key. The bag of rice tip found elsewhere is worth using, as I would have gone to that next, as it has worked with my wife’s phone when dropped down the toilet.