Shimano 3 Speed Internal Hub Gear on child bike popping chain on 3rd speed
Put the hub in each of it's gear selections ( esp the one where the chain falls off ).  Attempt to twist and push the cog.  If there is any play in either regard, that is probably your issue.  Could be adjustment of the shifter, but....