Internal SSD keeps disappearing and reappearing and will not format.
A few days back, while I left my 2017 15-inch macbook pro on my desk, I went to go do something and returned to see that the screen was off. When I restarted it, a black screen with a question mark on a foder started to flash. I attempted to do an NVRAM (this is also called PRAM I think) and an SMC reset multiples times, but there was still no sign of it working. I had even tried safe mode, but the same screen showed up. I am not really worried about my data as I had nothing super important on it, so I decided to enter internet recovery mode to wipe the disk clean and reinstall macos. When I entered Recovery mode, I noticed that the internal drive did not show up at all. Running hardware diagnostics mode seemed to show a VDH002 error. This is where it gets weird. After a restarts and leaving it alone for a while, the SSD seems to suddenly reappear. When I run diagnostics during this "reappearing phase" it says that there are no errors. When I try to repair the SSD, it gives me an error, and when I try to erase and reformat it, the reformat process goes halfway and the laptop suddenly powers off. When I restart recovery mode, it shows a screen saying my macbook shutdown because of an error and when I proceed to Disk Utility, the drive disappears again. I have tried mounting it one of the times it appeared and i get a Disenter error. I have tried all possible fixes on the internet, but none of them worked. I am pretty familiar around the mac environment and I have already tried the following:
1) using the diskutil command in terminal (gives an error saying that the EFI partition is damaged)
2) using fsck
3) force unmounting in terminal and force mounting in terminal
I have already booked an appointment with apple to see if they can fix it, however I am worried that they might charge me a lot for replacing it. I haven't used this macbook very much and it is pretty much in excellent condition and has suffered zero physical damage and/or liquid damage. Has anyone else had this same problem and does anyone know a possible way to fix it.
MacBook Pro 15″, macOS 10.15