When is a WebSocket connection closed, the org.apache.wicket.protocol.ws.javax.WicketEndpoint.onClose() is called. This will in turn broadcast an event message to a page that is bound to that connection. The problem is when the connection is set to the closed state before calling this method - then the event is not broadcasted. See org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.broadcastMessage() where is checked if the connection is open.
If a client (developer) of the wicket's WebSocket API need to know when a connection is closed, there is no chance in the scenario above.
I would suggest to let the AbstractWebSocketProcessor broadcast the ClosedMessage even if the connection is closed.