[TASK] More robust Reflection Service during cache:flush
This adds an additional check for the schema building routine
to avoid fatal errors during a cache:flush run with a potentially
corrupted reflection cache.
In particular this error appeared after deleting a package which
contained a Repository class.