I think this happens, when you tp the horse, it is standing on the same block as the glass pane, and it might not be able to recognize that the glass pane is there, since the horse was loaded in the map (tp'd) in that exact spot. Not 100% sure though.