I am not 100% clear on some aspects of the description, but here is what to look for.
Bottom bracket shells come in one width for road bikes and another width for MTBs. For example, for BSA shells, road BB shells are 68mm wide and MTB BB shells are 73mm wide. You're presumably on an adventure-oriented gravel bike, and I think many but not all have MTB-width shells. The first thing you need to know is road or MTB.
I can't find the crank model, but I infer from the BB part number that it's PF86. That's Shimano's press-fit standard. For this standard, the road BB shells are 86.5mm wide, and the MTB shells are 91.5mm wide. So, now might be a good time to get a ruler to the shell and measure it. Once you know if it's road or MTB and you have the BB standard, if you have a crank, you find a BB that's designed for the crank axle. You can put cranks with a 24mm, 25mm, 28.99mm (DUB) or 30mm axles in that shell, although the latter two are not as optimal because there isn't a lot of space, and that means they compromise on bearing size. That's what you need to know to buy a BB.
Canyon seems to have given you a 105-level road BB (NB: this is designed for a 24mm axle). The SRAM NX Eagle crankset is an MTB crankset. From what you said, it seems like the axle of the crank that you put in the bike is too long. If you have a road BB shell, I would expect this to happen. Furthermore, the crankset has a thicker axle (28.99mm) than the Shimano BB can accommodate (24mm). You will not be able to put the crank in the 105 BB.
Basically, if that bike uses road standards and you want a smaller chainring, then you might look for something like a GRX crankset which may have 38t or 40t chainring options. Third party chainrings might also be available. Like I mentioned, it is probably better to get a crankset with a 24mm axle, but you may do just fine. The Shimano crank would work with the drivetrain if you went there.
The last thing is that SRAM's current road cranksets are designed for slightly larger rollers than normal. That's another reason to not go with SRAM. You mentioned a SRAM PG1130 cassette, which is 11s and designed for standard rollers. From this, I am inferring that the drivetrain isn't the 12s Apex, which is designed for their larger rollers.