macOS Utilities doesn't recognize internal ssd (but normal usage is working fine)
If my suspicion is correct, your Mac boots to an older version of macOS Recovery and Disk Utility of that older version doesn't know APFS, so it just hides the partition.
First, make sure that View → Show All Devices is selected in Disk Utility. With this enabled, all drives should be visible – regardless if Disk Utility knows how to handle the filesystem. This should at least allow you to format the drive.
You may also try Internet Recovery. If you're starting your Mac with the keys ⌥⌘R held down until the Apple logo, it should boot into the latest macOS Recovery compatible with your Mac. From there, you should see all partitions and be able to reinstall the most recent compatible version of macOS.