Recreated the problem

The issue was that there was a BeanFactoryPostProcessor that had a bean dependency.