Fiona, as you asked for a simple project, it helped me in workaround this error. I created a new small project, and PW with I2C OK.
It is not the 1st time that I see that after freezing PE and writing long code, trying to reuse of the PE not always succeed.
Thank you, I understand that this is a bug, but consider my question solved. I copied the files from the new project I created to my application, and it works OK.