Smart playlist unexpected behaviour

It’s a bug that was reported about 3 years ago. They issued a couple of fixes, but they weren’t successful. Here’s the old thread: