or just follow the pool registration update section carefully - pool deposit not added when calculating txOut during re-registration:
txOut=$((${total_balance}-${fee}))
echo txOut: ${txOut}
the initial registration contains the pool deposit:
txOut=$((${total_balance}-${poolDeposit}-${fee}))
echo txOut: ${txOut}