Did you hire that clown of a teacher?
Did you hire that clownish teacher?
My idiotic friend
My idiot of a friend?
The two variants of each example you give are more or less synonyms, but the structures with of a are more informal and convey more about the person who uses it.
Of a is an idiom which can also be combined with other parts of speech, not only with nouns:
—used to indicate that someone or something is a particular type of person or thing:
- her idiot of a husband [noun + of a + noun]
- It is not that much of a problem. [adverb + of a + noun]
- How big of a piece do you want? [adjective + of a + noun] (M-W)
As for clownish teacher and my idiotic friend, they are less informal and more neutral. The structures with of a also point to feelings in the speaker such as anger, irony, irritation. It can also express positive feelings like admiration:
- an angel of a girl [an angelic girl]
- a beauty of a woman [a beautiful woman]
- a mountain of a man [a man as tall as a mountain]