The bug I expected to find was a case of the framework documentation and all related example code I've ever seen doing it wrong but the wrong thing works as long as you're not trying to do the specific thing that I'm trying to do, in which case a different approach is required. As I was writing the code I remember thinking to myself, how could the data I'm trying to pull out possibly get into the thing I'm trying to get the data out of, and indeed, it wasn't there.
The bug I didn't expect was adjusting the value of the wrong variable in a loop, thus making the loop infinite and locking up the program. Easy fix.