Self-Handicapping as an Ego Defense
Self-handicapping is the act of creating an obstacle to your own performance before a task.
More
If you fail, you can blame the obstacle instead of your core intelligence or ability. If you succeed despite the obstacle, your perceived capability is magnified.