Seconding Neil's caution
G'day EW, all,
You will be OK if you keep the whole turnout on a constant grade. See below
This is about as tight as you can have a turnout on a grade with transitions and not bend the turnout.
I also wouldn't recommend trying to pull a grade transition immediately after a turnout on the diverge route. It is a whole lot easier getting a smooth grade transition once the tracks come back parallel, with probably far less chance of derailment. On a grade transition immediately after the turnout diverge route, the track is trying to twist the bogie 3 different ways simultaneously on the bogie pivot pin. Remember most of our model axles are fixed and unsprung, - and the wheels won't be able to follow the rails as well as a real bogie can follow a track misalignment.
Where it gets interesting is on the vertical curves. I wholeheartedly second Neil's caution about vertical curves -ESPECIALLY AT THE TOP OF THE GRADE - where your transition comes from the grade back to the flat. At the bottom of the grade, you just simply leave stuff behind. Get this wrong at the top of the grade and you have an instant runaway.
I can get away with vertical curves in the above photo because I am running short single wagons across this track BUT if you couple 2 wagons together then there is NO WAY you will be able to pull off grade transitions like these without leaving stuff behind.
Please have a look at https://forum.mrhmag.com/post/middle-school-model-rr-vertical-curves-12198545 both the concepts in the original post and the "Whoosh Factor" post. The Whoosh Factor post also should give some idea about the type of rail butchery required to get smooth vertical transitions without kinking the rail itself.
Please also be aware if you have more than 1/2 a KD coupler head height mismatch between wagons standing on a vertical curve then you are entering "breakaway territory" where a minor track imperfection or any "bounce" in the train caused by a minor loss of traction/speed variation/etc can cause a catastrophic misalignment failure at the coupling head and a WHOOSH.
If you are running bogie rolling stock, then you may be in for a nasty surprise at just how gradual the summit vertical curve has to be and how much horizontal distance this vertical curve will chew up to avoid a WHOOSH. It gets much worse if you are planning to run long passenger cars and autoracks through the summit vertical curve rather than 40' or 50' long box cars only.
This top vertical curve is probably going to be he most critical piece of track you are going to have to lay on your whole layout. The consequences of getting it wrong will be rapid and spectacular.
Good Luck, but with some careful planning hopefully you won't need it,