check if the rommon variable is bypassing the startup configuration
force the switch into rommon by pressing ctrl+c when it starts booting up
once you see the "switch:" prompt check for following
switch: set
check if you see following variable set to 1 in output
SWITCH_IGNORE_STARTUP_CFG=1
if you see the above then set it as 0 and reset
switch:SWITCH_IGNORE_STARTUP_CFG=0
switch:reset
This should stop the switch from ignoring the startup config
you can refer some more here
https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9400/software/release/16-6/configuration_guide/sys_mgmt/b_166_sys_mgmt_9400_cg/b_166_sys_mgmt_9400_cg_chapter_01100.html#task_icz_r4z_n1b