Why the destroying execute before the updating

Could someone help me to explain a question about why the destroying execute before the updating? And how to resolve it?
Thereinto, alicloud_slb_attachment have depends_on alicloud_instance.instance[0] and alicloud_instance.instance[1]. When I set the count of alicloud_instance.instance from 2 to 1, the destroying of alicloud_instance.instance[1] execute before the updating of ucloud_nat_gateway.
The execution process is as follows:
image
The GitHub address