Re: Problem: Chain comes off sprocket
I know you say the alignment "looks pretty good" but this is a classic symptom of improper alignment between the engine drive sprocket and the rear wheel driven sprocket. How are you checking the alignment? You need to lay a straightedge on the two sprockets and sight from the rear looking forward.
Roller chains will not run well if the sprockets are not in line with each other. Chain tension is also important. 1/2 to 3/4" slack.
Are you using a chain tensioner? If the tensioner bracket wasn't bent/twisted to align the tensioner wheel with the chain path then it might be pulling the chain off to one side. That too can be seen from the rear looking forward. Every component of a chain drive must be aligned with the other parts.
Sprocket size/number of teeth has no influence on chain alignment. It only determines the final gearing.
Age and Treachery Will Always Triumph
Over Youth and Skill & "Charlie Don't Ride"