It is hard to tell without seeing the code, but I can imagine two things:
1. Maybe you are using the same violet game attribute to store the star count for both levels, so when you solve level 2 it overwrites the contents of that attribute.
2. Depending on when you load / save your game, it could happen that the 3 stars for Level 1 were not saved yet, then you use the load game block inbetween which will load the value "0 Stars" for Level 1.
As I know now what you are planning to do, it should work if you are doing it like this:
1. Create a violet game attribute for every Level "Level1_Stars", "Level2_Stars", "Level3_Stars" and so on.
2. When you are in a level, put the rating in the corresponding game attribute. If we are in Level 2, put the value in "Level2_Stars" and so on.
3. Always Save after you have added a new Star value, Load only at the beginning of the game.
In this way it should work. If you don't want to create so many single game attributes, you can also use a list game attribute to store the values but these might need a bit more code blocks to handle them correctly.