To fix ENG-6666, make NValue cast operations produce un-inlined values

Could you explain where does the CAST occur for the CASE WHEN expression?  Why it is related to ENG-6666?