After upgrading from spring boot 3.5.7 to 4.0.0 I am unable to get beans from BeanFactory.

I have classes A1, A2, A3... implementing interface A. In old code implementation of A is selected at runtime dynamically based on request context using BeanFactory:

public A getA(String version) {
  switch (version) {
    ...
   case "5" -> return beanFactory.getBean(A5.class);
  }
}

This code now throws BeanNotOfRequiredTypeException because actual type is class jdk.proxy1.$Proxy....

When I add annotation @Proxyable(TARGET_CLASS) to all my A1..An classes, everything starts working as previously.