Not sure what's happening but this traversal does not return any results with gremlin-python:
When looking at the bytecode the python bytecode is different from the java bytecode. The java bytecode for the predicate is:
The python bytecode is:
This fix should likely be applied as part of
TINKERPOP-1857 (or after it is merged) as there were a few modifications in that branch around P to resolve other issues.