MacBook shows flashing question mark in a folder when battery is at > 70%
Based on the symptoms and the fact that you have no problem booting from an external devices means it could be, in order of most to least likely, the following:


Defective battery
Logic Board
SSD Drive 


The battery and SSD are "simple" to diagnose, but not very convenient (unless you've actually got a shop and spare batteries and Mac proprietary SSDs laying about)*.  Basically, you would try "known good" components to see if the problem goes away.  The logic board is the most difficult as you would need to either eliminate everything else as a possibility or use specialized tools to verify that the SMC and related components (i.e. power rails) were functioning properly.


  If the battery level is high, the internal ssd is not shown on boot (holding Opt),


What we know is that everything works so long as the battery level is not high because it tells us that the computer will boot and do everything it's supposed to but it won't see the actual drive itself; it's not just a missing file system.

A battery can swell and push everything out of alignment just enough to break contact with components.

The SSD could be failing since it's the only component that actually "disappears" from the system, but it works fine otherwise. Since the SSDs aren't SATA anymore and are now directly connected to the PCIe bus, you should be experiencing other difficulties and not just the SSD in isolation.

The reason I put the logic board higher in probability than the SSD is because the circuitry (managed by the SMC) is what regulates voltage.  Regardless of the charge or from where it's coming from (mains or battery) the SMC "system" ensures that the correct voltage gets to where it's going.  In other words, the voltage to the PCIe bus and ultimately to the SSD doesn't fluctuate.  If it does, then the problem is with the logic board, not the battery.

Either way, if and once you elminate the battery as a cause, you'll need to take your machine in for service.  Apple will have you replace the logic board, however a specialist (i.e. Rossman Repair; not affiliated, just a satisfied customer) might be able to find and replace the actual bad component at a far lower price.



* The 2015 and earlier MacBook Pro laptops had a removable SSD whereas the 2016 and later models have a soldered on SSD.  They can still be replaced, however it will have to be done by someone with the proper tools and skill-set for SMT PCB rework.  I left this info in for people with the same issue but earlier MacBook models.