Why doesn’t marriage come with a guarantee?
It does, in a manner of speaking, but they are guarantees that few are willing to honor or enforce. An example of a guarantee (of sorts*) in divorce is alimony. The idea behind alimony is to provide the future ex-spouse with sufficient financial support 1) to prevent the future ex-spouse from becoming a welfare charge and 2) to maintain as much as reasonably possible the lifestyle to which he/she became accustomed during the marriage, if the other spouse has the ability to pay that much.
*Alimony is by no means guaranteed in every divorce, but there is clearly a policy behind it based upon the idea that if you hitch your future to your spouse’s star by each of you claiming to be and stay married to each other for life, then if your spouse breaches that agreement while you honored it, you should not suffer because of your spouse’s breach.