OP, I too have been looking for a form factor like the off-the-shelf NAS units but the ability to run my own OS.
Terramaster has heard our prayers. Their F223 and F423 have the TOS on an USB drive, which you can remove and install your own OS on either another USB drive or on an NVME drive (or both NVME drives).