PS: I was the only developer and the client can't code, so they can't distinguish between a spaguetti and properly developed code. The client literally told me it was not due to performance. But that the work can be done by that other junior freelancer.
You should always be mindful that your role is to create something that someone junior can take over. And to grow your business so that junior is your employee.
You could have outsourced maintenance to that junior freelancer yourself and dropped your charges a bit.
That's how all businesses grow. The farmer eventually employs a farmhand, the storekeeper employs a shelf filler.