Your description of JIT-learning sounded more like learn-only-on-the-job than JIT.
When you say "should have learned more upfront" I don't see how that would necessarily have to be outside or within the job. Where you learn it is open and arbitrary. For me, it's a question of what's reasonably necessary or efficient, does it make sense to explore more or prototype at work? Outside of that, I would have to have a personal interest in it to explore it in my private time just in time.
Usually, I learn upfront unspecific to concrete work. And that experience and knowledge come in handy at work.
When I'm on the job I work on and learn what is necessary to the degree it makes sense. I prefer to fully understand, but sometimes that's not possible or reasonably, acceptably efficient. Then you can weigh risk vs cost and prospect. There's no way around weighing that each time and individually. Development, in/as general, is too varied to have one arbitrary supposed weighing to follow.