I suspect you’ll find that changing the IDE version isn’t going to make much difference. Community consensus is that the recent bug with Apply, and the code duplication, are back-end issues. I’ve been experiencing similar issues applying from chat, and it was the same on 0.40.4 and 0.40.3. This thread has some more:
Specifically for the whole-file duplication, you could try reading this: