Hello!
Please see the adjusted trigger attached.
As for the missing bets, I can't see the results of any of those races in the Program Log, i.e. their winners are not logged there. This means, the market was never settled or was deleted from the program before it could be finished or settled.
Did you see any of those markets with a yellow WINNER label across the winning horse?