If my boss was coming out and publicly criticising me and suggesting that I couldn't do my job I'd certainly be speaking to my HR department. Would you not?
Yes I would, but if my boss for Sunday league told me I was shite and I had to improve, I would hardly be considering a law suit.
Also on a completely unrelated matter, your boss would have spoken to you in private multiple times prior and wouldn't be saying you're shite at your job unless you were tbf. No-one is going to keep a shite worker and give them free money.