What was frustrating to me was that I knew my model had a diagnostics port that allowed direct access to the SSD (see https://9to5mac.com/2016/11/24/apple-special-cdm-tool-macboo...) to pull the data off of it, but the service wasn't offered when I went to get my machine repaired. I was forced to accept the data loss from having the logic board replaced.
I later had bluetooth issues on the same laptop, and that required another logic board replacement. Which, surprise, came with data loss once again. Also had a lot of fun learning with that repair that Apple changed the extension backups are stored as, and Time Machine can't recognize the new one as a restore source for some reason unless you rename the folder to use the old one. Wasted quite a few hours on that, and Apple's phone support had no idea about why Time Machine wasn't seeing it.
Anyway, moral of the story is, backup often, and have more than one backup method, unless you like losing your data.