We still talkin’ about the RD-RX800 clutch’d ultegra dangler?
You can use that (or the non-clutch RD-R8000-GS, or the 105 RD-R7000-GS) with the 11-40 cassette. Shimano won’t tell you that you can, but you can. 11-42 is dicey unless you use a wolftooth thinggummy. 11-46 is off the table, as far as I can tell.
You’ve only got 39T of official capacity to play with, so with the 11-40, you’re limited to 10T between chainrings if you want to run a double. With the 11-42, only 8T between chainrings. You can probably push that a little, but note @Eddbread’s report here that trying to push to 45T of capacity (16T between chainrings with the 11-40 cassette) is a no-go.