Of course, projects change their licences all the time, why wouldn't it be legal? There's a long history of startups who started with open source/open core gradually closing off or commercialising the licence. This isn't anything new at all.
This is why it's good to read licenses before adopting the tech, especially if it's at all core to your business/project.