Ainge dodge a bullet and/or was lucky with these 3 things:
The Winslow offer
He made offers to the Pistons, Hornets, and Heat, which reportedly would've cost the picks that ended up being Brown and Rozier, plus I believe the upcoming Grizzlies pick as well.
Jackson canceling his workout for Ainge, Zarren, and Stevens
This basically sealed the deal of Tatum ending up in green. I do think Jackson was Ainge's #2 and a good workout, coupled with his affinity for that player type could've catapulted him over Tatum.
Suns misfortune
The Suns landed Thomas with a team friendly contract, but there was 1 pg too many and Mcdonough decided to move Dragic, who was going to bolt anyways, and trade for Knight. Ultimately, he didn't want the same issues he had before, so he also traded away Thomas for pennies on the dollar. The result was winning games, playing a part in landing Horford and Hayward, and then being used in the Kyrie deal.