That is known as a fart, fairy, or rooster egg. It happens every now and then. I had one like it last year that didn't have a yolk in it, just the white.
Fairy, fart, wind, rooster eggs are usually from a tiny piece of tissue breaking loose from the reproductive tract, or an immature ova(yolk) and the body forms an egg around it. Color can be darker than 'normal' as the pigment coating released has to cover a much smaller area so is thicker. Can happen with any age layer, but more common with older layers.