Hi there I have just bought a Trek Madone SLR Di2 disc road bike. All the components are Dura Ace except for the rear derailler which is Ultegra. I was told that it could not be Dura Ace as when changing gear it would travel into the rear cassette. Would this be true? I am riding a 50 34 front chain ring. Hope this makes sense.
Possibly the bike has a cassette size that the Dura-Ace Di2 rear derailleur does not support.
The current DA RD-R9150 (short cage) rear derailleur has a max low sprocket size of 30 teeth whereas the Ultegra RD-R8050-GS (medium cage) will take up to a 34. If you have an 11-32 or 11-34 cassette, you do in fact need the Ultegra GS derailleur.
SS and SG versions of derailleurs don't just have different cage lengths and ability to take up chain slack, the angle of the parallelogram is different also - so the cage of a short cage Dura Ace derailleur may in fact interfere with the largest sprockets of a 11-32 or 11-34 cassette.
Di2 derailleur specs here: https://productinfo.shimano.com/#/spec/ROAD%20Di2%20spec/Rear%20Derailleur
Whoever told you that is a liar. Shimano Di2 parts have excellent compatibility between component groups. Here's a compatibility chart. Basically, as long as you're using parts of the same "generation" (10-speed vs 11-speed), you should be good.