A drive I am restoring has a plastic gear in the eject mechanism that snapped at the hub, as they all eventually do. No spare parts exist, so I measured it with calipers and modelled it in CAD. Notes in case you do the same.
Measure twice. Tooth count, outer diameter, tooth height, bore, and the thickness. If the pitch is wrong, the gear will mesh for exactly one rotation and then complain. I compared the module (pitch diameter divided by tooth count) against the mating gear before printing anything.
Orientation. FDM parts are weak between layers. Print the gear flat, with the axis perpendicular to the bed, so the layers run around the teeth and the load goes along them, not across.
Material. PLA is the first thing people try and the first thing that creaks and creeps. PETG is tougher and slightly flexible, which is nice for a gear that sees shock loads. Nylon is better still, but fussy. For parts near warm electronics, avoid PLA, it softens at a temperature that a closed case can easily reach.
Settings I used: 4 perimeters, 40% gyroid infill, 0.12 mm layers, and a slightly larger bore (about 0.15 mm clearance), because the printed hole always ends up a bit small.
First test with the drive running empty. It has been ejecting reliably for a week.