This commit moves the check on bean definitions having an instance supplier where they are actually used. Closes gh-31200