Weird error with authentication and match connections

I’m just trying to get a multiplayer template set up in Godot. I’m running into a weird error where my ability to establish a webrtc connection for a match depends on whether or not the connecting player was logged in when the match was created.

I run 2 clients, both log in, one starts a match the other joins. The match always shows up in the Nakama dashboard fine and both players can always join the match. I attempt to establish a WebRTC connection between the 2 peers. However the connection only goes through if both clients were already logged in when the match was created. In this case everything works perfectly fine as far as I can tell.

But, if client 1 logs in first and creates the match before client 2 logs in, then client 2 logs in and joins the match, webrtc does not connect. I get no callback for received match state. It appears none of the STUN/ICE protocol stuff is sent although there are no errors when calling create_offer(). I don’t understand it at all.

I’m using wrapper code shown here,