Also there is a bit of a time travel problem. I was also wondering about this after watching episode 40
Ninjaman and the Kakuranger grand power were destroyed in Timeline A
When the Gokaiger's went back in time they saved Ninjaman.
So now Ninjaman could have been in the legend war
The Gokaiger's have created a new timeline in which they don't have to go back to save the shrine
So the Gokaiger's can thank the Gokaigers for doing all the work
Big time travel fan here.