contains() in PShape is inverting the matrix twice, so it cancels itself out and hit-testing runs in the wrong space.
In PShape.java:
PMatrix inverseCoords = matrix.get();
inverseCoords.invert();
inverseCoords.invert();
inverseCoords.mult(new PVector(x, y), p);
That second invert() should not be there.
So for translated/rotated/scaled shapes, contains(x, y) gives wrong answers.
Quick repro:
PShape s = createShape(RECT, 0, 0, 50, 50);
s.translate(100, 100);
println(s.contains(120, 120)); // false, should be true
Expected: point-in-shape test respects the shape transform.
Actual: transform handling is wrong because inverse matrix is never actually applied.