The returned value "ret" may be nullptr in which case the code would crash because "object_get_instance_binding" can't be called on nullptr input.
This should be very easy to reproduce, I encountered it pretty much any time I called a method that returned Ref<Something>. E.g.:
Ref<GeometryInstance3D> instance;
instance.instantiate();
instance.get_mesh(); // Crash because no mesh was set for the instance and the returned value was nullptr.