Fix error in saving when adding new trial environments

Reviewer: Daniel Jao (post-commit)

Issue: GCP-9847