The 123 Zoo Mystery by Susan Pearson, 1991.
Ernie’s class at school, Room 123, has some fun class pets. They have a duck, a boa constrictor, a pair of hamsters, a toad, a rabbit, and a worm farm. Mrs. Lettuce, the pet rabbit, is going to have babies soon, and everyone is excited about it.
After a new girl, Hisako, joins the class, strange things begin happening. Someone lets all the pets out of their cages, and some toads appear in the classroom. Ernie wants to figure out what is going on because she’s worried that all the chaos will upset Mrs. Lettuce when she should be resting.
At first, suspicion falls on Hisako, who really likes animals, but Ernie soon realizes that there’s another explanation. William is the one who finds the clue that Ernie needs to figure out the mystery. Part of this story is about the lengths that someone would go to for the sake of a friend.
This book is part of the Eagle-Eye Ernie series.