As Tetsujin and ultrasawblade have aptly mentioned, this wording is used to describe the quality of something – usually something extremely good or bad:
that idiot of a doctor (a terrible doctor who is an idiot)
a real palace of a house (a house so big and splendid that it's almost like a palace)
a fine figure of a woman (a distinctive woman with exemplary qualities)
As for how to "reverse" these, that's tricky. Read on.
I'll start with "a real palace of a house" – that simply means the house is like a palace:
Indira lives in a real palace of a house.
Indira lives in a very palatial house.
Or, you could say the same thing with a little hyperbolical metaphor:
Indira lives in a house as nice as a palace!
However, I believe part of your question is asking: if we can say "palace of a house" to indicate a big, fancy house, then why can't we say "a house of a palace" to indicate a small, humble palace? (I hope that's what you're asking, because that's a great question!)
No, I don't think we'd say "a house of a palace," because "house" is too neutral a word. To use this construct effectively, the first word needs to have a strong negative or positive connotation (like "idiot" or "palace"). So, you couldn't say:
It was a real house of a palace.
Although you could say:
It was a real dump of a palace.
or maybe even:
It was a real hovel of a palace.
if you wanted to emphasize how unimpressive the palace was.
Now, on to the idiot doctor. You could rephrase this simply by removing the "of a":
That idiot of a doctor prescribed the wrong medicine!
That idiot doctor prescribed the wrong medicine!
Some might say that idiot is a noun, so the revised sentence should read, "That idiotic doctor prescribed the wrong medicine!" – and they'd be right. However, for some reason, the word idiot does get used colloquially as an adjective; for example:
Morgan wouldn't do that. He's not like that idiot doctor that you had back in the city.1
I think some idiot doctor told you you were in very poor health. I think some idiot doctor dwelled a bit too much on that and not enough on the future.2
As a matter of fact, Ngrams shows more hits for "idiot doctor" than it does for "idiotic doctor".
But what about:
That doctor of an idiot
Can we say that?
Well, the word doctor can be used to mean "expert." While "doctor of idiot" doesn't sound quite right, I suppose that, if you wanted to describe someone in a disparaging way, you could say:
Our boss is a doctor of idiocy!
meaning he does stupid things all the time, not just once in a while.
He was a fine figure of a man.
(I've switched the gender on this one, because I want to make sure we don't get confused about the word figure.) NOAD says that figure can mean:
a person's bodily shape, esp. that of a woman and when considered to be attractive : she had always been so proud of her figure
a person of a particular kind, esp. one who is important or distinctive in some way
So, I want to make sure we're talking about a fine figure of a woman (such as Margeret Thatcher, Hillary Clinton, Benazir Bhutto, or Marie Curie), and not a fine figure on a woman (which might be used when describing, say, Kim Kardashian or Gisele Bündchen).
This one can't be reversed quite like the other two. I can say:
The mayor is a fine figure of a man.
The mayor is a man of good stature.
These are both idiomatic ways of praising someone, but they don't work when reversed:
The mayor is a good stature of a man.
The mayor is a man of fine figure.
R E F E R E N C E S
1Cheryl Wolverton, What The Doctor Ordered, 2012
2Celeste Bradley, When She Said I Do, 2013