Solved the issue by going to File >> Project Structure >> Facets and then adding all the configuration files to Spring Facet.
After that it started detecting files in which the beans reside and was able to sort the issue.
IntelliJ giving this check is quite valuable and IMHO shouldn't be disabled.