This is my project configuration.
Given that the required and provided data types are the same, there shouldn't have been any problem. If someone can help it would be really appreciated. Thanks.
In IntelliJ, go to
File -> Invalidate Caches... -> Invalidate & restart.
(All checkboxes in "Invalidate Caches" were unchecked, and I just clicked "Invalidate & restart", and it worked for me.)
IntelliJ restarts and the issue is now fixed. ✅