Chemical diversity of super-Earths as a consequence of formation