On the subject of compatibility between different M2 form factor devices, the other thing to watch out for is the number of PCIe lanes supported by your motherboard M2 socket.
Some motherboards have multiple M2 slots but careful examination of the specs in the manual indicates they are not all equal.
Some slots support 4 PCIe lanes whilst others may only be 2 lanes (therefore operate at half the others speed.) Also some M2 slots PCIe lanes may connect direct to the CPU whilst others connect to the I/O chipset.
It can be confusing as to which is the best to use so experimentation may the the order of the day. In the end, the higher lane count sockets are usually the way to go.