Plane swaps decisions are a black box of which we'll never be privy to all the inputs and reason for - or told truthfully. We'd like to think they involve some of the logic discussed above (crew timeouts, inconveniencing the least amount of passengers, protecting connections, maybe flight revenue plays a part too). Its definitely a thankless job. The one thing you can count on is that its not going your way

.
I used to connect in BWI to get home to ISP and "my" plane would get taken away more than a random amount of times over the years, sometimes 2 -3 hour delays. I finally summarized that planes were substituted to begin cross country journeys, with ongoing connections while BWI-ISP was a short hop that overnighted at ISP or turned around to FL cities where ongoing connections were rare. The looks on peoples faces waiting to board to Orlando were sad...