After much testing, I found that although KWin resets the graphic system and reallocates the buffer and all, for some strange reason NVidia unmaps the memory on first `draw()`. As a wild guess, I tried working it around by syncing the GL state during the reset and it seems it works (although I will still test).
I personally think this is a bug in NVidia's drivers. I've got traces of syscalls and KWin functions (not OpenGL calls though). But I don't have much experience with OpenGL. Maybe someone could help to get this reported?
BUG: 382305