Welcome to the wonderful world of hardware!
Its hard getting things strong enough to stay together.
Im just a beginner too, but if a beginner sticks with something
xell eventually work it out.
Im going through the exact same issues except im making a cardian
joint and its just falling apart.
It looks like your axle is off angle, you need a smaller cog.
That rubber stopper is not strong enough to support the axle at
the correct angle.
Everything is like cooking, you need different ingredients and
method. You need a different recipe for putting the wheel on.
You can copy one, or u can figure out the best way yourself.
It looks like your using glue as well, and glue isnt even as
hard as solder is! Im using solder for mine but it just breaks
the same. You need something that fits and is harder than both
lead and glue to brace against.
You can only use glue and solder in non bracing situations where
it isnt critical for the machine at that point.
Tell us more about what youve come up with how to fix the problem
and what youve tried already - and ill post again.
But other than saying that, maybe my suggestion is a gear on both sides
might hold it in place better, one powered gear, and one bracing gear.
(thats how im dealing with my issues at the moment, myself.)
Even tho it doesnt look like you have enough space for it, in ur current setup.