It is normal for a few worms to die every now and then. This also happens in nature. You only have to worry if there are a lot of them. These are often the causes:
The container is much too hot. Do not place it in the sun in summer and do not feed it at temperatures above 30 degrees.
The container is much too wet. Drain all worm tea every week and add extra paper or cardboard.
You fed way too much and the whole tank is rotting. Then remove as much rotting waste as possible.
The container is too acidic. Too much acidic green waste, such as lemon, can make the container too acidic. Add extra eggshells (lime) and cardboard.
And don't give up too quickly! Often when you think that all the worms are dead, you see them crawling through your green waste again in the spring.