The words ‘be careful what you wish for’ are coming to mind. Also, FORESHADOWING.