Ultegra 2X cranks with M8000 group and 11-42t cassette?
In general 'road' cranks don't work on mountain bikes (I assume that's what you are trying to do here).

Road cranks have a shorter axle than MTB cranks to work with narrower bottom bracket shells.

Also, MTB chainstays are designed to accommodate smaller chainrings than road bikes. Larger chainrings will interfere with the drive side stay.