I think you would generally want to have potentially racy things related to the same producer in some kind of producer-specific queue.
Though it sounds similar to consumer not found Error and should probably be handled nicely by mediasoup itself.
P.S. There is just one thread in JavaScript unless you are using workers explicitly, it is just asynchronous.