I have seen a tool which is in two parts. In either part, you place both the plastic ball that comes with the tool and spices. You then screw the two parts of the tool together (it's plastic, it's easy). Now that you spices and the ball are sealed within the container, you can violently shake the tool to grind your spices to near dust. I've owned one, but because it was made out of plastic, the violent shaking smashed it.
The product name (as it says on the side) is the 'Flavour Shaker', and it is a (now discontinued) product marketed by the celebrity chef Jamie Oliver. I read through a few reviews (e.g. here) from when it came out, and none of them use a more general term to describe it so I think it's fairly unique as an item – there is no widely-used general term for the type of tool for regular home use.
I haven't seen this type of device as a home spice grinder, but in commercial/industrial settings, this type of device is called a ball mill.
Industrial ball mills will have a cylinder filled with balls. The item that needs to be ground is added, the the cylinder is then turned on an axis so that the balls & material tumble, with the balls pulverizing the material. (picture a laundry dryer, filled with steel balls, and using that to grind up "stuff".) These basically use the tumbling movement and the strength of the spheres (usually made from something like steel or ceramic) to pulverize the subject material (usually something softer than the spheres).
While ball mills traditionally use multiple balls, and a mechanized tumbling motion, the spice grinder you describe would work on the exact same principle.
I'm not sure if there is a specialized name for the specialized version of the ball mill you describe that is meant to be shaken & used for spices--but it would certainly be a derivative or subclass of a ball mill. I also suspect that a steel version would be much more durable--as you noted the plastic version would eventually shake itself apart from frequent use, or using it with very hard spices.