It’s not very common, but it happens. Usually fear and/or pain based. Especially if the horse has successfully left the gate in previous races, and has successfully completed previous races, something has changed for this horse recently. And that is usually a pain issue. He’s sore, and he is not looking forward to running at speed in the race, therefore he “dwells”. He is saying “NO”. Can also be a “fear” issue, due to something that happened in a previous race, being bumped hard by another horse, being injured by another horse, or being abused by the jockey in a previous race to the extent that he is not looking forward to the next time. The trainer and vets may or may not be able to find the location of a soundness problem, or know the source of the problem, but it may still be there somewhere. Doesn’t mean that the problem won’t heal and be sound again, with time and rehabilitation.
One side effect of working with a horse who has dwelled in the gate is that it can be a state of being “frozen”, which is basically so much fear and avoidance of the race that the brain quits working. The lights are on, but no one is home. In this situation, the horse is capable of doing “anything” without thought beforehand. The result of this is often flipping over, which can end up as being fatal for both the horse and/or the rider. If the situation that is bothering the horse is solved, and he is not asked to race again, and is not stuffed into a starting gate again, it may be that he will never freeze again, and he may be OK for you. But if you get this horse, watch him closely, make sure that he is “home” and thinking, that his eyes are not blank, shut down, in any situation that he finds stressful. Any horse can get this way, given enough stress in his life, but this one bears careful inspection with his history of dwelling in the gate. If he has a history of freezing in stressful situations, he may also have a history of flipping. Ask around about this. If he is a serial “flipper”, you probably don’t want to own him as a riding horse. He doesn’t want to be a racehorse any more, that is what he is saying.
Good luck.