I don’t know about your jurisdiction but here the intent absolutely matters. If both parties intend something different to what was written then the written contract can be superseded.
There’s also situations like this where mistakes can be ignored.
Otherwise you could have really bad situations where both parties are forced into a stupid contract that doesn’t make sense, or someone is forced to sell their house for £1.000000 rather than £1,000,000.