you can get a lot of examples where the targeting line shows passing through impassible terrain while a turn is playing back. This is because targets are choosen during orders. If the target was sighted at the beginning of the turn, then the target is OK. During the phase, when the unit attempts to fire, it will do another sighting check and if the target is no longer visible, then the firing unit will not be allowed to fire, however, the target line will still show up. If later in the turn, the firing unit attempts to fire again but the target is now in sight, it will get to fire. An example: unit A targets unit B. unit B is moving to behind a house. when turn starts, unit A sees unit B and targets B. Now, during turn B moves behind house. unit A will still show a yellow target line to B even after B moves behind house. But, when unit A tries to fire, it will not be allowed to since B is no longer in LOS. However, if B moves on past the house during the turn, A would get to fire later in turn. Something like this is my guess of what you are seeing but i can tell easily with save.
I dont have that particular one saved, but it should be easy to repro. The spotting is checked every 8 seconds according to the manual, so that could be the culprit.
"Fear is a darkroom where the devil develops his negatives" Gary Busey