setWithProperType decoded the form value straight into the destination field. Some JSON codecs write to the destination before reporting an error: jsoniter allocates a map, or replaces it with an empty one, before it reports a syntax error, while encoding/json leaves the field untouched. A failed bind therefore left the map field in a different state depending on the codec the binary was built with.
Decode into a temporary value and assign it only once decoding succeeded, so a failed bind never modifies the destination. The success path is unchanged.