The Avisynth documentation is confusing, but my understanding is that setting brightness and contrast for YUV video with Levels() is fine, but adjusting gamma using Levels() should ideally be carried out in RGB space.
However, I also think any chroma errors introduced by using Levels () to adjust gamma in YUV are theoretical and not of any practical consequence.