Does it happens with any data or just in specific cases ?
You can compare your algo with this one: Clustering · BetaML.jl Documentation
If I remember correctly I had the same problem when I didn’t implemented a minimum variance/covariance in the Gaussian…