I have a number of engines I have bought over the years that since I haven't had a layout to test them on. I know they have test tracks at the shows but I will add when a show is crowded it can be a royal PITA to find the test track, which may not be close at hand, have it tested. Not to mention based on the test tracks I have seen, there is limited testing you can do (do they even have a unit with rollers so you can test speed control). Most of what I have bought has been from places like Gryzbowski, who I assume have tested the engines so I don't feel as bad about not testing them. On the other hand if you are buying from some guy who likely is someone who buys from estates or is one of those guys with ads around saying "I buy trains", or even just a member selling off their own stuff, it should be tested for whatever you can on a test track because it is likely the seller didn't give it any kind of test and who knows how long it has been around since they tested it.
Could this have been innocent on the part of the seller? It is possible. Dealers means a lot of things, you have the pro dealers (like Just Trains), who likely have checked the unit out and know it works, what shape it is in. Then you have the semi pro dealers, which I guess includes the grumpy old men who shuffle their product from one show to another and don't seem to care about selling, but also includes people who know trains and are trying to make a decent sale. There are scammers in this bunch, who know something doesn't work but figure odds of getting blowback is small, but most will have reasonably checked them out because they know enough to. The last category of dealer is the flipper, and they are a crapshoot, they buy from estate sales and the like to do a quick flip..and they know little about the trains (want to tell? Ask them something about the engine, like when was it made, if ps2 what board it has 5v or 3v, does it have odyssey speed control, etc), or ask them (innocently....) how they buy their stuff, most will admit they buy from estate sales and so forth. Then you have non dealers, the people selling their own stuff.
The flippers would be the mostly likely for it to be innocent, in the sense that they likely don't have their own trains and wouldn't know how to test it,they honestly prob don't know the difference between TMCC and legacy, they are in it to flip stuff, quick sales, and they if they bought from someone selling their collection take at face value it ran, so pass that along. Someone selling their own stuff would have used it and could test it before selling it. The weekend dealers you would hope test it, given it is their main business, but not as likely as the pro dealer.
If this was not a flipper, was a weekend dealer, then I would say it likely was a scam, they knew it didn't work and banked on a sucker buying it without testing it.
In the end, the best bet is to take it to a test track and make sure it works. Hopefully the dealer themselves would go with you to check it out, and obviously if they refuse to allow you to test it, walk away. I don't know how test tracks work, if someone is buying a command engine who has never used it before, hopefully there is someone with the test track that can help them. Buying at train shows is something of a crap shoot, at least with auction sites you have some redress, you may not at a train show.
A class of response on here bothered me a bit, and it was those with the tone of "well of course it is the buyers fault, they can look on google, they can research it, and they would know that it couldn't be what they say". A lot of sales at train shows are casual purchases, by people who aren't looking for that one unique train, but rather are hobbyists not collectors who buy what they see and appeals to them. So if they buy something they like and the seller assures them it is the latest and greatest (when it is 20 years old), they may not even think to check. Caveat Emptor is true, but instead of being smug we also should realize that the casual buyer makes up a lot of this hobby and be sympathetic. The hard core train people, who know every variation Lionel or MTH made, etc, are a small group (on this forum it appears otherwise, but the mavens tend to congregate on places like this..which is great, because for more casual people, like myself, it is a huge resource). All I can say is if the more casual people get turned off by bad experiences buying stuff, they aren't likely to stay with the hobby.