I would try saving the project immediately after changing the codec. If that doesn't work then close out of Pr and relaunch it from a shortcut (Desktop, Start Menu or Taskbar) while you hold down the Shift+Alt keys. When you see the Home screen, go to preferences>media cache and delete all your cache files. Then try making the change again.