usually for professionals, if your profession as an engineer is mentioned in your ID, there wont be any problem in Dubai and they wouldnt refuse you a visa even if only 2 months is left. But the trouble will be from Qatar Aviation in Doha airport who wouldnt let you board a plane if you do not have one. So it is suggested to renew your RP and then take the chance
It happened to me once, but that time they let me travel after I signed an undertaking that incase Dubai refuse me the visa I wouldnt hold Qatar airways accountable for this. Not necessary they'll do it now...