It might be worth to point out that "doolhof" is literally the Dutch word for maze. According to etymologiebank.nl it originated in the 16th century, as a composition of "dolen" (wandering, having lost the way) with "hof".
Which means (court)yard. In some languages, it exclusively means the royal court. Its origin is apparently obscure, but I am guessing it derives from the Nordic word for 'head' ('huvd' in Swedish), which is also the base for the nordic word for ruler ('hovding' in Swedish).
To add to this, it can still have a similar meaning in regular Dutch. I would usually associate the yard-like meaning with the diminutive form 'hofje', and the the (royal) court meaning with an included article: 'het hof' (_the_ court).