It is important to test the clean install of macOS before installing any third party apps and before restoring/migrating from a backup, otherwise you may bring the problem back. I don't really see any software that is known for causing kernel panics.
An even better test would be to install macOS to an external USB 3 SSD so you can run macOS from the external SSD to see whether the internal SSD disappears at some point. If the internal SSD disappears from the Finder, then check the Apple System Profiler to see if the physical internal SSD appears on the right pane when you click "NVMExpress" on the left pane. If there is no information in the right pane for the physical internal SSD, then it means the SSD is most likely bad (small chance of a Logic Board issue). However, the SSD is the weakest link and the SSD for this specific model laptop has a high rate of failure. This is the only way to really confirm an SSD failure is most likely.
I suspect the SSD is failing since it mentions the SSD controller PCI link is down. The SSDs on this model do have a higher rate of failure. Assuming no liquid damage to the Logic Board, then the SSD is the most likely part to go bad since the SSD is the weakest link.
Lucky for you there is a third party SSD available for this laptop from OWC.
https://eshop.macsales.com/shop/ssd/owc/macbook-pro-13-inch-non-touch-bar/2016-2017
If you don't have a backup, then make a backup right away since the SSD could fail completely at any time. If the SSD fails, then it is highly unlikely that even an expensive data recovery service will be able to recover any data.
People should always have frequent and regular backups of their computer and all external media (including the cloud) which contains important & unique data. It is impossible to recover accidentally deleted data from an SSD after the Trash has been emptied, plus an SSD can fail at any time without any warning signs. With later model Macs there are even more ways to lose access to data.
Edit: I should add, most SSD failures will be detected when powering on the laptop or when waking the laptop from sleep. Putting the laptop to sleep for a short while and waking it back up is a good way to try to reproduce an SSD failure, but it may not happen every time.