Just to summarize and validate the situation/data points we have across the postings:
-Booting with drive connected to rear port 0, the SSD drive is visible on PCI bus but system does not present filesystem(s) (not visible under 'Storage', unclear 'NVMExpress')
-Unplugging and replugging in a front USB-C, enclosure/SSD drive is visible as a USB storage device and mounts filesystem, etc (though it takes a relatively long time)
-Unplugging and quickly replugging in to rear port 0, enclosure/SSD drive shows up a a USB device similar to having been plugged into front USB-C? (yes)
-Unplugging from port 0 and waiting 30 seconds, and plugging in to rear port 3, SSD drive is visible as an NVMExpress device and mounts filesystem as expected? (yes)
Besides testing another cable (which is now unlikely the issue assuming that last configuration holds and is reliable), does the system automatically mount the drive properly at boot if connected to rear port 3? (i dont have another cable to test it)
When unplugging and replugging in port 0 and the drive mounts as USB, is there any difference in the time to mount as compared to when plugging into a front USB-C? it's fast on rear... and works well after
Did the drive automatically mount when connected at boot to a front USB-C? yes, but it takes some time. i'm trying to boot, and i'm waiting 5 minutes... not mounted until now.
I don't have an explanation for why this drive would mount dramatically slower when connected to the front USB-C ports than the rear USB4/TB4 ports. Peak transfer rates can be up to 2-4x faster over USB4/TB4 than USB 3.x 10Gbit but that shouldn't be an issue for mounting.
For now let's assume the issue has to be one of these 4 things:
-NVMe SSD
-USB4/NVMe enclosure
-USB4 cable
-Mac Mini rear USB4/TB4 port 0
Then we have these data points:
1. Mac Mini M4 rear USB4 port 0 (assuming leftmost), connected at boot: tries to connect at USB4/NVMExpress and then fails (more details about this may be under the NVMExpress tree of System Information)
2. Mac Mini M4 rear USB4 port 0, unplugged and replugged after boot: works fine except at USB3.x (lower peak speed and other limitations plus annoying to have to unplug and replug)
3. Mac Mini M4 rear USB4 port 3 (assuming rightmost), unplugged and replugged after boot: connects at USB4/NVMExpress and works fine (unclear if same result when connected this way before boot)
4. Mac Mini M4 front USB3.x 10Gbit: takes a long time to mount but then performs well (of course lower peak speed and other limitations)
5. Mac 2013 USB 5Gbit: performs well but of course at 5Gbit
Given cases #2, #3, and #5, it seems unlikely the NVMe SSD, enclosure, or cable. Though given #1 and #4, I am less certain about the enclosure and cable. Plus I can't explain the long time to mount under #4 but not #2.
For now, I would try booting with the enclosure/SSD connected to rear USB4 port 3 and seeing if it connects to the drive as an USB4/NVMExpress device at boot and automatically mounts, too. If so, I'd say issue #4 is unrelated and the more important issue is that USB4/TB4 port went bad. If the system behaves differently whether the SSD/enclosure is connected to rear port 0 versus rear port 3, I'd return to Apple to fix (likely requiring a new logic/system replacement).
One other weird thing you could try as far as #1, #2, and #4, is plugging the cable into the Mac with the USB-C connector rotated 180 degrees. This should not make a difference in any proper cable/device/etc and should not make a difference with any USB4 device. I've only heard issues with this in case of USB-A <-> USB-C scenarios and so shouldn't make a difference. But given some of your unexplained results and testing this should only takes 10s of seconds, I would just repeat #1 and #4 above with the cable both ways for sanity's sake.
i notice something, even if i tought i was buying a thunderbolt 4 cable, i realized it's a usbc4 cable. maybe it's because of this?
The standards are way too complicated these days but the summary is that a USB4 cable might be of high-quality but it isn't certified to the same level. Whether it works in all USB4 situations depends on the manufacturer. An Intel-certified passive TB4 cable should "always" work for all USB4 and TB4 situations.