Cut the stale bread into 1 cm cubes and place in a large bowl.
Finely chop the medium onion. Heat some of the butter in a pan over medium heat. Add the onion and cook until golden brown, about 6-7 minutes. Remove from heat and pour in some of the milk. Add the egg, season with salt and pepper, whisk together, and mix this mixture into the breadcrumbs. Let stand for 10 minutes.
Chop the basil and mix into the breadcrumbs. Gently stir in a small amount of flour.
Cut the mozzarella into cubes. Using wet hands, form dumplings around each piece of mozzarella, sealing them completely. Bring a large pot of salted water to a boil. Gently place the dumplings in the water and simmer uncovered for 15 minutes.
While the dumplings cook, make the sauce. Heat the remaining butter in a pan over medium heat. Whisk in the remaining flour to form a roux, cooking for 1-2 minutes. Slowly pour in the remaining milk, whisking continuously to avoid lumps. Simmer for 3-5 minutes until thickened. Season with salt and pepper to taste.