Is there a significant downside in using body RID's as keys in a dictionary?

Was looking at getting tile cells from collisions and saw this post: https://www.reddit.com/r/godot/comments/13imumw/get_overlapping_bodies_and_cells_in_a_tilemap/

They put body RIDs into a list in order to get certain tiles on a tilemap, and then just loop through the list when operating on those tile cells.

What I want to do is almost the same thing, but saving the cell RIDs into a dictionary as a key, while giving it a value of the TileMapLayer it was detected on. Is there a significant downside into doing this? I don't know how performant RIDs are compared to normal integers in dictionaries.

Another question: Would there be a better way to detect collisions? Right now I'm iterating through the list of RIDs, converting them into tile data, and then checking to see if the tile data has the custom data layer I want.