漏れがあるかもしれませんが、ひとまずこれで動きました。
weight: yup.number().positive().integer().nullable().transform((a) => isNaN(a) ? null : a),