Invalid curves for ray-tracing simulation

hello to all

There seems to be a strange thing in the ray tracing simulation.
Some polylines are not valid. Note that only some of the polylines are valid after output (in pink). But the red lines show all the rays. There seems to be a reason for this that I don’t know.
At first I assumed that only the rays that hit the context are the valid lines (in pink). But it seems that this assumption is also wrong.
Can you clarify for me?

Hi @chris

can you help me for this?