Twin Bolt deals 2 damage divided as you choose among one or two targets.
If you cast Twin Bolt with two targets and one of those targets becomes illegal before Twin Bolt resolves, the remaining legal target will be dealt 1 damage. You can’t change the original division of damage.
You choose whether Twin Bolt has one target that will be dealt 2 damage or two targets that will each be dealt 1 damage as you cast Twin Bolt.