It’s because arg for logvar becomes big negative value and exp(logvar) goes to near 0.
The common trick is clip logvar above some value (e.g. -5) or exp(logvar) above small positive value (e.g. 1e-7).