Item to Summon/Dismiss Party Member

Hello everyone!

For my game, I'm hoping to add in an item that a player can use during a battle, which summons a party member that they've met previously in the game. This is all working perfectly. However, one the battle is over, I'd like that summoned party member to disappear. Once the item is used for a battle, it can't be used again.
I'm having trouble getting the party member to leave. Once the battle is over, the screen shows "Unexpected end of imput".

I'll add a couple of screenshots from the common events that I'm using down below. I'm using the instructions I saw in a previous post which works for people, so I'm unsure of what I did wrong:
okay - scene_is? is not valid in MV. ? was used in Ace, but MV would use something else.

Common events set to parallel process do not run during battle, so by the time that event gets executed, you're back on the map. You don't need the condition, because you KNOW you won't be in the battle scene.

I think you're safe to remove the condition completely, and just leave it removing the party member and turning the switch off.

UNLESS you have some plugin that makes parallel common events run during battle.

Original thread: https://forums.rpgmakerweb.com/threads/item-to-summon-dismiss-party-member.95214/