As I (roughly) understand it, every tx output has a public amount Pedersen commitment and also the real amount (along with a blinding factor) is encrypted such that only the recipient can know it.
My question is twofold:
What prevents the party creating the output from putting the wrong amount into the secret such that recipient is unable to generate the correct commitment when trying to spend it?
If nothing prevents this, then how does the code handle this case once the receiving party receives it? This utxo would seem to be unspendable unless the recipient can somehow obtain or guess the true amount.