The PRG-ROM area is not RAM. Do not think of it as RAM. Bank swapping with swap the complete ROM bank out of access and swap the complete new ROM bank into access.
Be sure that when your code completes the bankswap (either the STA instruction that writes to the PRG bankswap address) or returns from a JSR to an existing function in the fixed bank, that you have valid code in the same location in the new bank or your game will crash.
Like, mapper 2 has a bank size of 16KB ($4000 bytes).
You had some code, and the JSR to a bankswap function was at ROM address $C567. Fine, let's say that's the address with iNES header. That means you have bank 3 swapped in (ROM $C000-FFFF not counting header), and address $557 within the bank.
Say you want to swap in bank 8 (ROM $20000-23FFF not counting header). The JSR is 3 bytes, so your new code better continue at address $20000+557+3+10 = $2056A.
Also, note than mapper 2 is considered to be a set of mappers with some including "bus-conflicts" mapper. I'm not entirely sure what that means, just that you better write the number of the bank you want to swap in, to a ROM address that has the same value, or the value written to the bankswap register will get corrupted (or at least you should assume it can, whether the emulator emulates that flaw or not).
Like most games will do something like
where address $C000 has a list of all possible banks (00, 01, 02, etc.) If you don't have free space at the end of the table before other code, you'd have to move the list and update the pointer. (and hope the game handles all its bankswap calls through a single function)