I tested a bit further, and figured out that the problem got introduced somewhere between 5.1.17 and 5.2.0.
I updated the reproducer accordingly.