That will work, you can indeed run 4-wire (L-1, L-2, Neutral and Ground) 30 amp to a 50 amp outlet safely.
The only "Danger" in doing this is the "Click of darkness" (Tripped breaker)
This can easily happen in some RV's. so I will tell you about it now.
After I got mine back from the inverter install I checked the order of the circuit breakers.. Turns out they put BOTH air conditioners on the same leg.. That twill trip your 30 amp breaker as often as not.
The solution was to move one of them to the OTHER leg (Actually I did a full re-balance of the panel)