How to undelete files removed with rm -rf on an APFS SSD disk? Is there any way to restore files removed with rm -rf on an APFS formatted SSD?
No. It's very unlikely you're going to recover anything.
The reason being is that when you delete something from an SSD, the way it's deleted makes it virtually impossible to recovery.  Basically, when you delete something, it tells the drive to mark the sectors as deleted just like in a traditional hard drive.  However, when subsequently asked to read back the data, the drive will respond back with either zeros or garbage.

How to get the &quot;securely erase&quot; function of Disk Utility on El Capitan &amp; Sierra
Can the data on an MacBook Pro SSD be recovered after formatting using Disk Utility

Note:  It's not impossible to not recover any data, you will need to send it to a lab or to the manufacturer who can get around the mechanisms that secures the data.  However, this is usually very cost prohibitive unless it's for forensics and provided that the sector hasn't been overwritten already.  Unlike magnetic media, it only takes a single write to send the preexisting data into oblivion.