Can't fail Underground Undercover
Solution 1:
You can try to get banished from the Institute.
Under most circumstances, becoming enemies with the Institute immediately fails Underground Undercover and any active, related Railroad quests and starts Burning Cover instead.
There are a few ways to get banished, but the following one seems appropriate:
- Kill any named Institute personnel.
This seems to be the easiest way for your purposes, especially since you almost did this anyway :)