I am confused too. It makes zero sense that there would be a bandit trying to ambush people immediately outside the town walls.
Even weirder, a new farmer/worker turned bandit. He clearly hasn't done this much and he is very clearly desperate to support someone, which would mean that someone is close, ether in town or just outside it, yet he is just outside this towns walls instead of seeking help from the town? He would for sure get help from the town, so must be from elsewhere, so he ventured all the way to this town instead of staying near someone he is trying to urgently support yet didn't even try to get help from the town? The more you think about it the weirder it gets.
He also managed to hit a horse running full speed with a spear throw, which is a odd skill for a farmer, worker, or even a hunter, as they would stick to bow for ranged and wouldn't want to carry a weapon that they can only use for one attack and then have to retrieve. Throwing a disposable weapon to start is ambush tactics and would be a skilled learned for against other humans only, so soldiers or experienced bandits, but he doesn't seem to be a trained soldier and is for sure not a experienced bandit. Could be a lucky shot, but is also worth adding to the list of odd.