Self-Serving Bias

Attributing positive events to personal skill but negative events to external factors.

Wikipedia