Failed to remove unavailable entity

I have a few wyze contact sensors that died due to low battery. I removed them via cofiguration->entity. However one of them still appearing there. When I tried to remove it again, the popup says:

Only 0 selected entities can be removed.
You can only remove 0 of the selected 1 entities. Entities can only be removed when the integration is no longer providing the entities. Sometimes you have to restart Home Assistant before you can remove the entities of a removed integration. Are you sure you want to remove the removable entities?

click “remove” but the entity is still there.

what is the best way to deal such case? I’ve read someone said I can shutdown HA and remove the entity from core.entity_registry file, is this safe?

for unavailable entities from mqtt, should I just remove all related topic in mqtt server?

thanks

I have the same problem. Cannot remove generic camera entity.
“Only 0 selected entities can be removed” ticked for removal and is still there.
2 years… no answer?