What would make a custard turn out looking like scrambled eggs?
I've had this exact same issue when making Creme Brulee. If you heat the mixture too long it will turn to the consistency of scrambled eggs. I have figured out that if I gently jiggle the pan a few minutes before it is supposed to be set and you will see a slight wobble. Repeat this for the next few minutes until it wobbles less, then remove it immediately

This is the method that works best for me. There are so many variations due to the oven, altitude, number of eggs in your mixture, etc. to give you an exact time. It took me at least 15 tries to finally get my creme brulee recipe right but now I know what to look for when its done.