Even before AI, take home exams were a bad idea. In theory students were supposed to promise to work alone and not share work but in practice many people, especially those taking the class with friends, worked together.
When I was studying my CS degree (2018-2022) it was actually encouraged to work together outside of classes with fellow students. We had a CS discord run by the school (or maybe volunteers from the school? I dunno) with diff channels for different classes. I also worked a ton on studying with my friend who was in a lot of the same classes as me. I think that was insanely helpful, especially for a lot of the theory heavy classes it was great to have someone to bounce ideas off.
I'm not against students working together -- as you note in some classes it is encouraged and often group projects are assigned. But this is different from the idea of a "take home exam" where students are supposed to work alone on the honor system, which is naive at best from the professor.