Nice. Thanks !
I then perform an intersection between this and the target polygon, hopefully you can do something similar with a line segment.
I'm also not 100% sure what your code is doing but I am concerned that you are only getting 2 cell vertices. Cells are not square and need more than 2 points to correctly define them. Also a cell, no matter how small, occupies 2d space on the sphere (even if it's 2mm^2 area). So any intersection with it and a line will result in a sub section of that line, not a point, so not quite sure what your logic is.