Files on an SSD drive that malfunctions are lost, generally without any possibility of recovery. Encrypting the drive makes recovery of file fragments impossible.
The SSD drive on MacBook Pro since about 2015 models is soldered to the mainboard, for maximum reliability in a system that can be subject to multi-G forces just being moved about in an ordinary way. Iif the mainboard was replaced, your files are lost.
The agreement you signed when you submitted your Mac for service spells out that your files are NOT guaranteed to be returned to you, that you have made all the backups you wanted, and that you are OK with that.
Apple provides the really good and free Utility Time Machine, built into MacOS, to back up your files. All you had to do was attach an appropriately large external drive and tell it to GO.
Electro-mechanical devices fail at random, arbitrary, and capricious times.
The most frequent reason for most failures is 'just because'.
Your specific failure is most likely caused by an advanced scientific principle called ...
... 'bad luck'.