I think on_pre_player_mined_item is the wrong event for on_entity_gone, as it doesn't contain the mined entity. Instead you should probably handle on_player_mined_entity and on_robot_mined_entity. You might also want to handle on_entity_cloned, for compatibility with other mods.
(The same goes for your other mod, logistic cargo wagon.)
Let me correct that, I had some incorrect information.
AFAIK you should listen to on_player_mined_entity and on_robot_mined_entity in order to remove the proxy entities. Looking through your code, I can only find on_pre_player_mined_item. If I understand the API documentation correctly, this is incorrect. (on_pre_player_mined_item only fires if an item is put into the players inventory. For example, this causes proxy entities to stay behind in the map editor).
(same applies to your other mod, logistic cargo wagon.)