Issue #20254 fix some bugs for init_instance run.