A Miracle card must be cast in the same step you draw the card (even if it’s a sorcery).

When you draw your first card for the turn (usually in your draw step), you can reveal it as you draw it if it has the Miracle ability. When you do that, the ability triggers and goes on the stack as soon as you’re done with the action that let you draw the card. So […]

Read more.