This is an Apple bug reproducible on some systems, it was submitted to Apple and got id 15196228
The MAX_TEXTURE_SIZE reported by OpenGL could be very different from the real value. On some systems they differ more than 2 times. In case the texture is too big all OpenGL commands go well and do not report any error, just the texture is not rendered or rendered incorrectly, so there is absolutely no way to detect such situation from the code. Native example suffers from the same issue, so it's not a bug in Java. Firefox suffered from the same issue and they have hard-coded 4096 as a maximum texture size, however this is too little for us. So the current implementation of the max texture size querying look more or less correct. This could be improved only when apple fixes it's bug in OpenGL.