I have my own experience 3 years back in the same situation. I got offer letter from my present company in Qatar and resigned from the company in Dubai. In the meanwhile I got my work visa from Qatar (approx 10-12 days). I completed one month notice in Dubai and straight away flown to Qatar.

There is no problem at all. Go ahead with follow up of your visa from Qatar. It will not take much time, as far as your new employer in Qatar is serious to apply your visa.

The other way as you said, if you will go back to your home country, there will be a lot of other formalities to complete and will delay your process. Better go ahead with the direct flight to Qatar.