LWJGL Invalid Operation (1282)

I’m trying to turn on/off vsync in my game after creating display and I get this error.

Any ideas why I might be getting this? I saw somewhere on the forums that this should be working.