-
as far as I can tell, in the UK this happened in 1988 (with the introduction of the burgundy machine-readable passport) @kyle_snow_miron/1452715060170735616
-
(which was mainly introduced to comply with US standards for their visa waiver programme, fun fact for you there)
-
I should say, UK passports were not free of gender before that - they would include title ("Mr" etc), they had a subsidiary section for wives, and if children were included their genders would be marked. But explicit recording and categorising of gender is relatively new.