Commit 26395 introduced a check for self-intersecting polygons. The code is not straigtforward but involves some equations which can easily implemented in a way that does not work like expected.
A unit test should verify that the checks are working correctly.