1. Killing the dude while in prison... I'm not convinced this is as easy as it sounds. Yes, he is defenseless at the moment. But access to him must be very limited, and telling the magic association that he came back from the future has several hurdles. First, does the mc want to share the info about his time travel magic? Because, second, they kindly won't be convinced without a demo which, third, he is not able to do on his own at the moment.
2. I don't think this would have been too much of a deus ex machina if written a little differently. Instead of making it sound like a miracle born of wild magic explosion and extreme emotion, it would have been better as a display of last minute wit from the mc. We already know he can time travel. Just write it as him using it consciously, using the rampant magic as fuel to supplement his missing potential. The way this turned out is lazy and shows the mc couldn't think of it by himself (stupidity or panic, it doesn't matter). The "it just happened" way is indeed bad writing, even more so when minor alterations would have made it at least ok if not actually good.