Using Entity as index for tables

So, I’m using Entities as index for a table and they get removed sometimes and become NULL, though they stay in the table and the key is NULL obviously, but the weird part is there can be more than one NULL index in the table like so:

Why is it not being garbage collected/being set to only one NULL index in the table?

Indexing the table like GAMEMODE.ItemPrice[NULL] returns a nil, even though the table has more than one NULL index member.
It is possible to remove them though by doing a pair loop and comparing the key with NULL.

Each one of those indexes are a different entity object. Whether they’re NULL or contain an entity is irrelevant… since they’re all different objects.

That was my hypothesis for it behaving like that. Thanks for clearing it up.