If you notice such an error, even though the relationship that Doctrine complains about hasn’t changed and you’re selecting the fresh object from the db. Don’t need to persis here as suggested as it won’t help anyways as the object (in this case a User instance) is already in the DB, so it doesn’t need persisting.
Multiple non-persisted new entities were found through the given association graph:\n\n * A new entity was found through the relationship 'App\\Entity\\Trade#user' that was not configured to cascade persist operations for entity: Proxies\\__CG__\\App\\Entity\\User@00000000534bea8e000000001661e3c7. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(..,cascade={\"persist\"}). If you cannot find out which entity causes the problem implement 'App\\Entity\\User#__toString()' to get a clue
The solution in my case was to clear the entity manager, which causes all the entities currently managed by the Entity Manager to be detached and then start from scratch by selecting the entities again.
#1 clear the Entity Manager here
$this->em->clear();
#2 use the id to find the trade $this->tradeId
$trade = $this->tradeRepository->find($this->tradeId);
$trade->setStatus("tradeCreated");
#3 and now Doctrine is not complaining when saving the entity
$this->tradeRepository->save($trade);