The guy made a mistake. You can't even say it was a purely mental mistake, as clearly misreading the ball and being aggressive was part of it, not just being unfocused or stupid.
On top of that, it was his first major league game since last season, and he's barely played in any since 2018. While on the one hand that means he darn well better be good at the little things, when you are a team scraping the bottom of the barrel for bench players that's what you get.
And if you really think that kind of message needs to be sent just to set an example, or for the manager to set a tone, I'd say that's a much bigger problem. You think Rhys Hoskins was like, "cut that guy, he cost us a scoring chance when that could have been me"? No, he probably has Jankowski's back, and wants to see him do better next time, because the Phillies don't have any other back-up CFs (except for the two guys we don't want to see in the majors again).
Also had the Phillies done that he probably would have been claimed by a better team. Everybody's thin.