From your description, your code enter Boot Rom after executing SW reset.
I suggest you identifying the problem on HW or SW.
bypass ISP, Make sure all ISP pins pull up. see if the problem persists.
ZhangJennie_0-1623911089246.png
It's possible your code invoke ISP by accident ( see Reinvoke ISP command). this will also cause code enter boot rom. if so, you need check your code by self.
Have a nice day,
Jun Zhang