What happens if a P2SH redeem script is lost? Assume Bob creates a complicated Bitcoin Script and asks Alice to make a payment to a hash of this script. (Using a P2SH transaction)
If Bob loses the script (i.e. the source code of the script), is the payment transaction going to be locked forever?
Yes, if you lose the redeemscript, the funds are going to be locked forever. In order to spend a p2sh output, you need to both reveal the redeemscript that hashed to the address and then satisfy the conditions of that redeemscript. If the script cannot be recovered, it cannot be satisfied and the funds will not be spendable.