I had the same problem, but I found a solution, or at least a workaround. I exploded the polylines into plain lines. Surprisingly the lines didn't disappear, and the Z-coordinate of the lines were all at 0. Then I was able to trim the lines. So the ploylines had an elevation, but the lines didn't.