Repository: godot
Issue: TileMap GetCoordsForBodyRid() may silently deliver an invalid coordinate position (0,0) when colliding with Area2D
Labels: topic:physics,needs testing,topic:2d

### Godot version

4.1

### System information

Windows 11

### Issue description

I have an area2D and tilemap with tiles having a physics layer defined.

The Area2D has methods subrscribed OnBodyShapeEntered and OnBodyShapeExited where I check is the body a tilemap AND IF it is I call the tilemap .GetCoordsForBodyRid() to get the tile where collision happened.

I then change the (colliding cells) within these methods. 
OnBodyShapeEntered I replace the cell (SetCell) with an alternative cell that has modulated color.
OnBodyShapeExited I SetCell to the original cell.

Here is how this looks in practice:

https://github.com/godotengine/godot/assets/51578785/1d32cb42-e32a-473c-8425-1ba8b9abbbd5

The error happens at the end, where I fail to return/set the tile map cell to the original value.
This is because the signal RID that I get in OnBodyShapeExited seems to be invalid with the TileMap.

So the code I execute in OnBodyShapeExited:
`Vector2I effectedTilePos = myMap.GetCoordsForBodyRid(bodyRid); `

will fali sporadically - sometimes it works sometimes not. 
And when I say fail silently it means I dont get the proper Vector2 but rather the result is Vector2I(0,0).

After debugging I notice A LOT following errors in Godot Debugger:

```
E 0:00:06:0515   Godot.NativeInterop.NativeFuncs.generated.cs:345 @ void Godot.NativeInterop.NativeFuncs.godotsharp_method_bind_ptrcall(IntPtr , IntPtr , System.Void** , System.Void* ): Condition "!bodies_coords.has(p_physics_body)" is true. Returning: Vector2i()
  <C++ Source>   scene/2d/tile_map.cpp:2897 @ get_coords_for_body_rid()
  <Stack Trace>  Godot.NativeInterop.NativeFuncs.generated.cs:345 @ void Godot.NativeInterop.NativeFuncs.godotsharp_method_bind_ptrcall(IntPtr , IntPtr , System.Void** , System.Void* )
                 NativeCalls.cs:9858 @ Godot.Vector2I Godot.NativeCalls.godot_icall_1_1074(IntPtr , IntPtr , Godot.Rid )
                 TileMap.cs:525 @ Godot.Vector2I Godot.TileMap.GetCoordsForBodyRid(Godot.Rid )
                 CharacterBody.cs:27 @ void CharacterBody.OnBodyShapeExited(Godot.Rid , Godot.Node2D , Int64 , Int64 )
                 Area2D.cs:631 @ void Godot.Area2D.BodyShapeExitedTrampoline(System.Object , Godot.NativeInterop.NativeVariantPtrArgs , Godot.NativeInterop.godot_variant& )
                 DelegateUtils.cs:62 @ void Godot.DelegateUtils.InvokeWithVariantArgs(IntPtr , System.Void* , Godot.NativeInterop.godot_variant** , Int32 , Godot.NativeInterop.godot_variant* )

E 0:00:06:0515   Godot.NativeInterop.NativeFuncs.generated.cs:345 @ void Godot.NativeInterop.NativeFuncs.godotsharp_method_bind_ptrcall(IntPtr , IntPtr , System.Void** , System.Void* ): a number is required
  <C++ Error>    Condition "error" is true. Returning: String()
  <C++ Source>   ./core/variant/variant.h:830 @ vformat()
  <Stack Trace>  Godot.NativeInterop.NativeFuncs.generated.cs:345 @ void Godot.NativeInterop.NativeFuncs.godotsharp_method_bind_ptrcall(IntPtr , IntPtr , System.Void** , System.Void* )
                 NativeCalls.cs:9858 @ Godot.Vector2I Godot.NativeCalls.godot_icall_1_1074(IntPtr , IntPtr , Godot.Rid )
                 TileMap.cs:525 @ Godot.Vector2I Godot.TileMap.GetCoordsForBodyRid(Godot.Rid )
                 CharacterBody.cs:27 @ void CharacterBody.OnBodyShapeExited(Godot.Rid , Godot.Node2D , Int64 , Int64 )
                 Area2D.cs:631 @ void Godot.Area2D.BodyShapeExitedTrampoline(System.Object , Godot.NativeInterop.NativeVariantPtrArgs , Godot.NativeInterop.godot_variant& )
                 DelegateUtils.cs:62 @ void Godot.DelegateUtils.InvokeWithVariantArgs(IntPtr , System.Void* , Godot.NativeInterop.godot_variant** , Int32 , Godot.NativeInterop.godot_variant* )

```


### Steps to reproduce

I will add the zip project. Basically use the mouse to move godot icon to individual tiles.

### Minimal reproduction project


[CollisionTests.zip](https://github.com/godotengine/godot/files/12188114/CollisionTests.zip)
Here is the example project - its in CSharp but I dont think it makes a difference.