Yeah, we knew about other side effects of the event code for handling the party switch functionality, and implementing a full fix for the problem (and talking SierraLee into adopting that change) has been on my "back burner" for some time.
Technically speaking, the code was just implemented so that a party switch was executed whenever the "R" key is pressed. ("W" on the keyboard, "Start" on my Logitech controller.) In the official build that happens irrespective of whether that button press is processed while something else is happening. So in your case, it appears that a party switch was initiated the moment you arrived on the map, hence my belief that the controller is sending false input. The code also assumes Simon's group is at a specified location on the map, which isn't the case until they enter, so that would be the "nil" conversion to integer at the top of your error chain, trying to pass a null coordinate to party swapping function.
The IK Castle version of the code has a failsafe that cancels the party switch if another event is happening simultaneously, but neither version controls for the situation that was originally reported, a user pressing "R" at the same time they enter a doorway or use a staircase. That requires custom code that I've been too busy or too lazy to write.
What I've done is replicated the code that stops the "R" press if other event code is executing from the IK Castle map, and then changed the order of operations on both maps so that it evaluates if other code is running prior to checking if "R" is pressed. So even if the controller is spamming "R" presses, the listening event won't happen while the map opening cutscene is running. In which case it should immediately get caught in an infinite loop switching between Simon and Yarra once the events end.
Not that I wish the expense of a new PS4 controller on you, but I sincerely hope this is a "gummed up"/miscalibrated controller issue and not that you're the first person who's ever played that section with a PS4 controller. Because the latter means SL probably has to scare up some beta testers to verify the game genuinely does support PS4 and XBox controllers... and then figure out how in Ivala's name to get it do if it doesn't...