What you are pointing out as a strategy sounds almost valid. You can spawn headless instances of your game per Nakama match and then destroy each instance after each match is concluded.
However, the usage of the Nakama server as a relay between unity instance and players in a way that players send input to Nakama and Nakama relays that to the headless instance, does not seem necessary (unless you are planning on doing something I cannot think of right now). When you create a headless instance, you can inform the players via Nakama to connect to the socket (IP: Port) the headless server is listening to. This gives you options as to use UDP, for example, for sending input from players to the headless server. When the headless server decides the match is concluded, it can use Nakama API (just like player unity clients) to tell the current match to close; This can be used to calculate whether the match was concluded successfully, whether some of the players abandoned the match, how much XP each player gets, etc.