Was the horse programed to be in another race that day. If so the fault goes to groom, identifier, driver, even the starter.
If not and the horse was entered in the wrong race it goes to trainer, race secretary, program proof reader and then down the line.
Everyone assumes the authority above them is doing their job.
I once raced a horse several times at the fairs. There was one that beat me every race. One day a guy told me the horse was not eligible to the fairs. He was right. The trainer was a big time fair participant and the first fair entry was not checked. After that every race secretary assumed the horse was eligible.