This is done in the frame for GUI loading so we need to explicitly set this when loading files in the cli Fixes #17790 (cherry picked from commit f8a25d20)