Fix breakage caused by early function loading

Fixes #17955

cc: @kiorky