[mcs] Don't apply reference type is optimization for dynamic expressions. Fixes #19423