With the help of Hackman238, finally got this issue resolved. Was due to a couple maintenance windows being "broken" (somehow). This was the code that was used to find and fix the problem:
for mw in devices.maintenanceWindowSearch():
try:
mw = mw.getObject()
mw.productionState()
except:
print "problem is %s going to delete it" % (mw.id)
mwp = mw.getPrimaryParent()
mw.unindex_object()
mwp.removeRelation(mw)
commit()
pass
Courtest of Hackman238 (Shane Scott)
EDIT:
Couldn't figure out how to make code tags work here.