This bug is exotic and as far as I know not reproducable on any Wikimedia sites, but I am going to enter it here in case it is helpful to someone else someday.
I was writing a new Special Page for a private wiki. One of the functions of this special page was to perform deletions on other pages and images via direct calls to Article->doDeleteArticle and Image->delete.
After calling either of these functions it appears that a $wgOut->mRedirect gets set to target the deleted page. This interferes with the output of my Special Page by redirecting the content. I've yet to figure out where this is occuring (and it is obviously quite well buried, because I spent a long time looking without success).
The obvious workaround is to cancel the redirect by doing the equivalent of $wgOut->mRedirect = '' after the deletion calls.
It also appears that this bug is not triggered by normal deletions because action=delete is embedded as a process in the normal article and image page views and the redirect is somehow being automatically cancelled if the current Title is the same as that for the hypothetical redirect. (In other words, it doesn't try to issue a redirect if it thinks it is already at the right page.)
Obviously an exotic bug like this isn't much of a priority since it doesn't affect Wikimedia directly, but I felt it was worth posting a note after wasting several hours trying to pin down where the redirect was coming from.
Version: 1.9.x
Severity: minor