Look up your owners manual and go to the section on the pcie/m.2 configuration. See what slots run at what speeds, and use what pcie lanes.
Your CPU has X pcie lanes and you're able to use all of them. Your chipset also has X pcie lanes, but some are used for the USB ports, some for sata ports, etc. If you put the SSD into a slot that's already maxed out on pcie lanes then it's probably going to drop the lane count of multiple things down (the process isn't super smart).
My desktop has the two x16 slots connected directly to the CPU, and 2 of the M.2 slots are connected to the CPU. If I install just my GPU and just my main SSD I run at full speed, but if I add a second M.2 SSD my GPU drops to x8 speeds. I think there's a 3rd slot hidden away that's on the chipset.