I was going through some old CDs and they were pretty scratched. Some of them could not be read so my computer was a little slow on making a decision and spitting the discs back out. At one point, a certain CD didn’t come out at all (and was not showing up anywhere). In fact, I completely forgot it was in there. By that time, I had to resort to opening Terminal and typing in:
drutil tray eject
Then your disc will be out in a jiffy.