Don't worry - no matter what you think...as far as I can tell from what you're saying it's a perfectly normal reaction to a manic situation.

1. Your ex is nearby - never good
2. This caused your work to suffer
3. So your work placement prospects are bad.

Connection between them...it's not your fault