Get input point from 3D point

Most probably because :
…position method on a input point always returns a point that is transformed into model space…
as you can read here
InputPoint#transformation-instance_method
You got the face2 right because the method finding it is designed to work with model ordinates of point.

Now - as far as I see - you want to draw a line into a group which have different coordinate system.
Reading further down of above link text:
… If you are using the edge, face or vertex method on the InputPoint though, you will probably need to use the transformation method to transform the data that you get back from the selected entity.
Meaning that you can get the transformation of the point related to the face related to group.
(Note that this transformation is a same as you retrieved earlier for the group)

So something like this should work…

....
        ents = grp.entities
       # corrected
        tr_ip1 = ip1.transformation.inverse
       #corrected
        pt2tr = pt2.transform( tr_ip1 )
        line = ents.add_line pt2tr, [pt2tr.x, pt2tr.y, pt2tr.z + 20] 
....

I hope you have been checked
my other answer for you
about the transformations.

As you realise the transformations are tricky things in SU Ruby API, you need a lot of time , “trial and error” to understand.
Myself just learning too. So, could be some mistakes in my “examples”.