2018 Macbook Pro sometimes shows flashing folder with questionmark but sometimes boots perfectly
i have a fairly new macbook pro 2018 without touchbar and it started to show the infamous flashing folder with a question mark. I understand this is some type of startup disk error but my issue is that i only get this error sometimes. Sometimes my MacBook will boot up and work perfectly, other times it won't find the startup disk (or any partition for that matter) for a long time. I have to constantly keep powering it on and off upwards of 10 times for it to finally boot up properly. I reformatted the computer but the issue still persists.
I tried looking online a lot but i can't find anyone who only has this issue SOMETIMES, it's inconsistent but when it does boot it works absolutely perfectly. Can anyone help or point me in the right direction?