Try using wiimote_connect and wiimote_disconnect manually in this case. MAybe it works then.