Sale Badge In Query Loop of Variable Products

I want to display an ON SALE ribbon on the products in a custom query that have a sales price. The products are all variable products and only certain variations have a sales price. I have tried to use this display condition on the sales badge element but it does not show on any of the products which are on sale. Did I set some thing up wrong?

Screenshot 2024-06-10 at 11.06.52