This is usually caused by following an outdated diff or history link to a page that has been deleted.
If this is not the case, you may have found a bug in the software.