Gábor Varga thanks for the test case and your explanation!
I've confirmed that this is an issue in 5.0.10-SNAPSHOT, so apparently this got broken after 5.0.10.Final.