register_setting sanitize callback $input is null

It turned out to be nonce related: the form didn’t have a nonce. Solved this by adding wp_nonce_field to the form.