It's true there's a huge industry for white label car parts manufacturing in Japan. These companies are extremely agile. They will adapt. Taking contracts for novel new parts is their daily DNA. They already work extensively with foreign car companies, so they're not anchored to the foibles of Toyota and Nissan.
Furthermore, electric cars still need complex parts! Sensors of all types, electric windows and door locks, key fobs, air conditioners, steering wheels, windshield wiper motors, etc. The list is so very long.
I have one wild guess as counterpoint. Today's Japan would never mandate a shift to all-electric vehicles. Why? It would destroy their domestic car sales industry. In Japan, many people only keep their cars for a few years, then sell them back. Used Japanese domestic cars are worth a lot of money. These cars are exported to other countries around the world, where they're resold. I imagine Japan could no longer resell their domestic cars abroad, at such huge volume, if all their cars were electric. Many countries do not have the conditions or infrastructure to support large-scale deployment of EVs. Batteries would probably need to be replaced, lowering the profit on the resale. And so on.