Judging the other teams is going to be more difficult, but for your boss and teammates, at some point in the process before you accept the job offer, say you want to spend a little time with them.
Some combination of luck and observation, and/or good social skills, might elucidate how the team's interactions go with other teams.
As mentioned above, a refusal to do this is a huge red flag. Even for a company like Google, which routinely does this. There are a zillion horror stories resulting from their closed allocation policy, like the hardware guy who was given a job doing vaguely hardware related Python programming. Without the option of moving to another team for 18 months per Google's policy (de facto if not de jure), he had no choice but to quickly resign to avoid ruining his career.
And I should mention what happened in my last job, where I wasn't able to do that, and the boss I was assigned to, who had absolutely no buy in, he wasn't given a choice about my working for him, took an instant dislike to me. That did not end well.
Echoing the theme of this subthread, for my last N jobs, in all but one recruitment I was substantially lied to. The one before that said I'd get enough time to review the org's long abandoned legacy software before a very firm (government contract) commitment to how long it would take to make it viable again.
Before that, the manager didn't reveal she'd taken an offer to move to a subsidiary that was splitting off. She guilelessly told me that the previous attempt to hire someone in my position failed because she'd mentioned that. That job ended when
The company before that had a pattern of hiring a "second" techie only after the current one had given notice, without telling prospects they'd soon be responsible for it all.
Two before that I learned later that my boss didn't want to hire me, but I was the only one who passed his whiteboard programming test (which for me was so easy I hardly remembered it by that time) and the company would have otherwise died, and I was fired as soon as they convinced the guy they really wanted to move from SV back to the D.C. area.
Before that, I joined a company just as a couple of devil investors took it over with what we soon enough learned was the express intent of owning all the company; they deliberately sabotaged the launch just to have 100% of nothing (granted, this was investor betrayal, in the denouncement 13 of us simultaneously resigned).
Before that, no bad faith can remember, at least starting out, and those jobs and organizations were substantially more successful. If this sort of thing has indeed become a pattern, we shouldn't be surprised by general economic stagnation, whatever the other secular causes there might be.