1. increase the friction by einfeilen of grooves.
2. Use a long hexagon bolt.
3. Use 2-3 threadlockers (ie washers with many hooks).
4. 2 hexagon nuts properly tightened.
It would be 5. Best not to continuously change the angle from the shower head afterwards.
So who has the necessary parts, the joint piece does not need to throw away.