I think this return statement should be within the if (defaultNetDev == service->ethernet().value("Interface")) statement. Otherwise the function will exit on the first online/ready service without setting the default route.