Startup disk not found after overheating
I have a macbook pro 13" retina (Late 2013) and it was running the latest macOS Catalina (10.15.5). I was running chrome when suddenly my laptop overheated and the system froze, as a result I had to hold the power button to shut it down. But after I booted my macbook pro, there was this folder with question mark sign flashing on my screen. I tried everything that I knew of - resetting PRAM, SMC, internet recovery and hardware check. While in recovery mode, I could not find the startup disk in disk utilities. Once , while I was trying internet recovery, the startup disk showed up out of nowhere and I was able to go till the login screen but as soon as I enter my password, it froze again and the startup disk had vanished again. Another time, when I was booting into my macOS which I had installed on my external HDD, the original macos startup disk again popped up and I saw the kernel panic screen which said in different languages - 'Your computer was restarted due to a problem. Press a key or wait a few seconds for it to restart'.
I am currently running macOS on my external hard drive.
Also, I'm really sorry for this awfully long question. I tried to provide every detail that I could.
MacBook Pro 13″, macOS 10.12