I got the same error a few weeks ago. First time I ever heard of a flattened exception.
I have a BaseController class with two derived controller classes (AccountController and PersonController)
Each of the derived controllers had a createModel() method with different arguments. I decided to clean things up by adding a createModel() method to the BaseController. I started with PersonController and all seemed well.
I then cleared the development cache and suddenly got the flattened exception error. Something in the cache creation process had determined that the arguments to AccountController::createModel() did not match the arguments in BaseController::createModel(). PHP did not care since AccountController was never calling BaseController::createModel. But the cache builder was. Fixing the arguments solved the problem.
The question does not give us much to go on but you might take a look at any inheritance type changes that you may have made.
ProfileMenuBlockService.php.