Is it the gear in your 3rd and 4th photos? It looks as if the plastic gear hub cracked? Can't be certain from your photos as they aren't
clear or illuminated well. If the hub isn't cracked I'd run a small pin through the plastic gear, brass piece and shaft to keep them
all together.
The third photo shows the two gears that should turn as one. I thought about a pin, but the plastic 'lip' that couples with the brass is too thin.
An alternative, don't know it it would be appropriate, is to put a proper sized washer on the shaft next to the gear that wants
to go awol then use a small collar next to the washer to keep the gear from moving but keeping it captive against the brass piece.
Unfortunately, the brass gear turns inside the black plastic gear like a bearing. [
]