I should probably explain better what I'm trying to do.
The code is run when a collision between 2 Area2D occurs. Both are part of a scene that also has a Raycast2D, used for something else. Here however I try to find our where those cross for a visual effect at this point (which is not where the collision itself happened).
I tried this following your advice (A1... just for readability during testing):
var A1 = $Target_RayCast2D.global_position
var A2 = A1 + $Target_RayCast2D.cast_to
var B1 = _area.get_parent().find_node("Target_RayCast2D").global_position
var B2 = B1 + _area.get_parent().find_node("Target_RayCast2D").cast_to
var intersection_point = Geometry.segment_intersects_segment_2d(A1, A2, B1, B2)
it does however return NULL.
print(str(A1))
print(str(A2))
print(str(B1))
print(str(B2))
returns
(915, 520)
(915, 5520)
(475, 630.000122)
(475, 5630)
which are the correct coordinates.