Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I agree that the architect is more common, but I have encountered the form architect John Smith enough times that it doesn't set off my "weird grammar" radar. I mainly consume American English if that is a factor.
I don't understand your explanation for sentences 1 and 3. You seem to be saying that they are not correct. The OP asks about "it was built by architect John Smith", not "it was built by architect". "It was built by architect John Smith" sounds fine in my ears.
The pun is that an idiom is used but the words should be interpreted literally. The brain first thinks, "how can not talking make me thinner", Half a second later it dawns on you that the literal meaning is "Keep your mouth shut so that food cannot get in". Voilà, slight amusement ensues!