Fix being unable to find declaration for substituted callable from library

#KT-5900 Fixed
#KT-5901 Fixed