was canceled suddenly because Apple decided they had been wasting resources on it instead of investing that energy into AI
which could have easily happened with Steve Jobs at the helm. you're talking as if this outcome is specifically a Tim Cook problem when Steve Jobs could have been even more stubborn and continued the project only to cancel much later.
a car project is naturally a long process and you won't know when to stop until it get too big. see: all the EV efforts happening today.