I'm not trying to act dumb here, but I do not understand this.
There was no offence as he wasn't offside. So they should have checked the offside and then gone, right he is onside, is it a foul, yes, award penalty.
Otherwise goals would be ruled out for the same reason? Goal goes in, offside...