I'm still on 4.4.4, but the very first thing I did on my S5 was the result of what your problem is..... strange volume settings or other "actions" taking place.
I turned OFF every one of those "Gesture" type features. Once I had that done, the phone started being reliable.
I've heard that MacroDroid was not working with 5.0, but I just looked and it was updated this week, as of May 16, 2015.....
I have the Pro version of MD which allows lots of macros.
I have a couple of macros that sense the screen:
- Screen is locked, set the Ringer Volume to MAX.
- Screen is Unlocked, set all volumes to Desired Levels
Before I started using MD, I would miss phone calls, which for me with bad ears is all to easy to do anyway. So it is vital that all volume levels be at MAX.
A 2nd app is neat in that will will cancel that stupid S5 feature of low level ring and then make it louder on each succeeding ring... what a PITA that is, people hang up before I even knew the phone was ringing.....
This app fixed that, the 1st ring is at Max Volume now:
* Ring Volume -Disable Increasing Ring - Android Apps on Google Play