Yes, it’s generally possible, and people have done it—but RTD rules matter a lot.
From shared experiences, Qatar Airways usually allows transit through Hamad International Airport on an RTD if have:
Your RTD is valid for at least 6 months
You have a confirmed onward ticket to the Maldives...