This question already has an answer here:
Make Feature Layer with an SQL Selection Expression against a geometry property like length fails when the source feature class is in an
in_memory workspace. An otherwise identical model works just fine when the feature class source is in a regular workspace (file-gdb).
ERROR 000358: Invalid expression Shape_Length = 0 Failed to execute (Layer of Zero Length Lines).
I'm using ArcGIS Desktop 10.3.1 but don't believe the issue to be version specific.