If you don't have to sign first and then change, the player's home team will lose the free agent in vain; Sign first and then change. Teams can exchange players or draft picks. For players, signing before changing can give players a higher annual salary (compared with signing directly). This is because the player's team can use the Larry Bird clause (provided that the player meets the requirements of the Larry Bird clause) to renew the player's contract, and the salary after renewal can be higher than the highest salary that other teams can pay. Even if another team can give players a top salary, it will give a maximum increase of 10%. However, for the players' teams, the Larry Bird clause can be increased by 12.5%. So players can earn more money. Also, for the opposing team, signing before changing can allow them to recruit new players when they exceed the salary cap.
This last point is very important. For those teams that can't sign high-paid free agents above the salary cap, it is very useful to sign first and then change, so that the team can get the high-paid free agents they need.