In German we call that a “Schildbürgerstreich”. Yeah, no kidding, we have a word especially for things like that.
It refers to a foolish or absurd act, often involving a misunderstanding or misapplication of logic, typically in a humorous context - especially around buildings. The term comes from the “Schildbürger” tales, which depict the antics of the supposedly foolish citizens of the fictional town of Schildburg.
Edit: the fictional town was called Schila - thanks to diplomjodler3 for pointing it out!
You are right! Brain fart on my side with Schildburg… Schilda is correct!