I faced a similar issue. I adjusted my code to leave at least 1 unfrozen and it seemed to run fine. I believe that it is due to a limitation where you cannot delete rows such that the only remaining rows are frozen. I am not sure how much this helps, though.