Fix various potential bugs with model local variables

Many recursive function on ExprNodes were not correctly recursing into the
definition of model local variables.

(manually cherry picked from commit a377fc83)
6 jobs for 4.6 in 4 minutes and 43 seconds (queued for 6 seconds)
Status Job ID Name Coverage
  Build
passed #21903
build_linux_32

00:01:01

passed #21904
build_linux_64

00:01:20

passed #21907
macOS
build_macOS

00:02:06

passed #21905
build_windows_32

00:01:37

passed #21906
build_windows_64

00:01:40

 
  Prepare
passed #21908
aggregate_builds

00:00:03