The fact that there are so many alternative languages for the JVM or which transpile to Javascript suggests that (at least to many people) that neither were ideal choices for their current uses.
That is like saying the existence of cargo trucks, pick-ups, minivans, campers, and rv's shows that the underlying 'internal combustion engine' technology is flawed.
I think it rather shows that the technology is so useful that it is able to spawn different implementations aimed at slightly different use cases.
JS was made to animate monkey on a screen, and now it powers internet.
Technologies start with one goal and evolve.