Did more tests and now understand, it affected by rotation
var n: Node2D = Node2D.new()
var p: Vector2 = Vector2(3.0, 5.0)
var p_local: Vector2 = n.to_local(p)
n.rotate(0.5)
var p_local_rotated: Vector2 = n.to_local(p)
var p_calc = (p - n.global_position).rotated(-n.rotation)
print("p_local = ", p_local) # p_local = (3, 5), same as p
print("p_local_rotated = ", p_local_rotated) # p_local_rotated = (5.029875, 2.949636)
print("p_calc = ", p_calc) # p_calc = (5.029875, 2.949636)