If the action is called using a HTTP POST, you don't need to call persistenceManager->persistAll(). As for the error, try emptying the cache (./flow flow:cache:empty) and recompiling your application (./flow)