@Reference (or its more current equivalent @DBRef) tells Spring Data to store a reference (like an ObjectId) to another document, not to embed it.
You must save Z documents first:
Z zObj = zRepository.save(new Z(...)); // save first
Grp grp = new Grp();
grp.setX("someValue");
grp.setY(List.of(zObj));
grpRepository.save(grp); // now it will store the DBRef
or
You've to embed Z directly inside grp
Then don’t use @Reference — just declare it as a regular field:
private List<Z> y;