My personal theory is that a joke has to be always both surpising, yet fitting.
The pattern presented in the article fits that requirement. Maybe it is even equivalent.
But that’s just a necessary condition for a good joke, not a sufficient one.