Issue while interacting with villagers

Okay, so I have a villager area in my base and have never had an issue with it. I don’t really trade with my villagers often, so I’m not sure how long I’ve had this problem or if it just started today. Basically, every time I click on a villager to open their trade menu I get kicked from the server and given an error message. It’s hit or miss. Some villagers I can interact with and then some I get kicked while trying to interact with them. I’m also unsure if it is a me thing or a server thing (probably a me thing). I do have spotty wifi, but it usually works fine while on TC, just a little laggy at times. Anyway, I included a pic of the error if that helps any!

It’s a known compatability glitch caused by using 1.19 client, revert minecraft back to 1.18.2 to fix it.