https://bugs.winehq.org/show_bug.cgi?id=51765
--- Comment #7 from Konstantin Kharlamov hi-angel@yandex.ru --- FTR, the error actually happens earlier than in XFreeGC, it's just due to async X11 behavior the error only comes up later. I tried enabling synchronous behavior, but for some reason it didn't help.
Anyway, the actual operation may be decoded by looking at "request opcode"; and for me it is DRI3 and function (minor opcode) is DRI3PixmapFromBuffer.
Wine itself doesn't call DRI3PixmapFromBuffer, but it may be called in Mesa. So, some kind of OpenGL operations might be leading to this error.
No idea how to debug in further. Apitrace doesn't record anything. Debuggers are of no use due to WINE creating many processes.