Improve assertion error message for Apply
and TypeApply
#18700
Merged
Apply
and TypeApply
#18700