And presumably at some point Dr Upton has been employed as a male, so employers would need to complete information according to the P45 submitted.
If there were a gap in employment he might not supply a P45, but HMRC still holds data on birth date and sex so if there is a discrepancy between the information they hold and information submitted, it suggests at best an error that needs to be corrected.