To me, a reseat/enclosure check would be the first step in going forward. If it works in an enclosure and not on your mobo then that's a whole different kettle of fish.
I just had an idea. My partner's laptop has an m.2 primary drive I think, so I could pull hers out and put mine in (assuming I can get the heatsink out of the way) and test it that way. I knew I should've got an enclosure for her old drive, y'all talked me out of it :P
To me, a reseat/enclosure check would be the first step in going forward. If it works in an enclosure and not on your mobo then that's a whole different kettle of fish.