Last week I got fired from a job where I've been working for about a year and a half. There is a head of the department and the team lead. The team lead was always giving me positive feedback regarding my performance. Feedback is something I asked him about explicitly to make sure I was on track and it was always more than positive. There is no written record of this, it was always in a meeting.
Last week I got cut off from everything suddenly and I assumed it was some computer issue but then I received a call from the department head saying that due to the very poor performance they need to let me go. I mentioned that this is the first time I hear of it, but it was quickly brushed off repeating that the team lead has told him multiple times my performance was very poor.
Why would they not inform me about my poor performance earlier? Why would my team lead repeatedly lie to me? I would expect to get at least a warning during the last year and a half, especially considering I asked for feedback explicitly.
Was there something I could have done differently to avoid this? I was completely caught off guard and am rushing to find a new job, since this was completely unexpected. I have no way to contact the team lead at all as I was cut off unexpectedly. I fail to understand how all of my contributions are now summarised to very poor performance and nothing else.