Difficult to say as this is only a small part of the code. However it looks like your using a websocket client field that is a static field in your constants class, and assign to another static field in that class. That might not be a cause to the specific issue here, but if I’m correct, its certainly an anti-pattern. Look at other bindings how they create a websocket connection. For example look at the deconz binding.
These are not constants and don’t belong in a constants file.
YIOremoteBindingConstants.java
// List of all used global variables
public static final WebSocketClient yiodockwebSocketClient = new WebSocketClient();
public static @Nullable Session yiodockwebSocketClientSession = null;