Sounds like maybe you simply crashed the game?
Some games have actual game bugs, just like anything else. There are plenty of examples of 'real game bugs' (note the sheer number of revisions some arcade games have)
Sometimes running things like highscore hacks, or cheats can also break things. (some Taito games have anti-tamper code that is thrown off by this kind of hack)
Also sometimes bootleg sets do this, as the original games had protection that wasn't properly patched out by the bootleggers.
If it's an original set and reproduces consistently (every time in the same place) without you having to do anything that could be considered 'abnormal' to trigger it, then it could be an emulation bug.
Sometimes it can be a genuinely corrupt ROM, eg. with Marvel vs. Capcom in older versions, the parent ROMset was actually a bad dump, this was only found out later, at which point it was replaced. However if you're running the latest MAME version, and it doesn't report any checksum mismatches while loading you're using the best known dumps at least.
If you're using some ancient version (eg. the 2003 / 2010 builds that some insist on) then the emulation was terrible, all over the shop, and this kind of error was much more frequent due to incomplete protection simulations, bad dumps that hadn't been identified, CPU emulation errors, misguided speedup hacks, limitations of MAME's memory system, and sometimes simply cases of incomplete research etc. Bonze Adventure for example would quite frequently crash with onscreen messages prior to last year when the protection chip was dumped and emulated.
There are one or two cases where current versions have similar issues (Aaron broke later stages Atari's Rampart last time he did a big Slapstic update, and has never come back to fix it) but those are incredibly rare.