Calling discard on an entity that is never even present in the world does nothing. Your renderer will still hold the reference to the entity and therefor prevent it from being garbage collected.
What you should do is check that the level is still the same (use an == comparison on the level instance, do not check the dimension). If it has changed, remove the old entity.
The version you are using is no longer supported on this forum.
Please update to a modern version of Minecraft to receive support.
Currently supported versions are 1.18.1/1.18.2 (Latest) and 1.16.5 (LTS).
Particles are not entities. Particles are also entirely client side and controlled by the graphics options. If the user disables particles in the options you will not be able to detect them (because they do not exist). The game will also simply despawn old particles if there are too many.
That said, you can get all particles from ParticleManager#particles (it is a private field, so you need reflection to access it).