This sentence is the start of a new paragraph. The ellipses are as written:
??? Maruko was raising the Rhinoceros Beetle grubs in a plastic fish tank that she'd put in the corner of the hallway, but... . A month went by.
I don't understand what てなわけで means. I read this question, but was unenlightened since I can't understand というわけで either.
My guess is that the わけ part together with the のだった part later on suggest that the narrator is explaining the reason for something. Later sentences got on to say that she forget to look after them for a month.