Robust variational neural posterior estimation for simulation-based inference