Does the install process run successfully without changing that variable and only applying those two commands you mentioned?
Because if you skip FRP_WIPE
you’ll skip…
flash_image_or_abort "${sn}" devinfo "${IMAGES_DIR}/devinfo_for_factory.img"
…as well. That’s the partition responsible for storing OEM unlock information and they specifically added that step after people kept bricking. Not sure I’d skip that one…
For the having to manually change the slot part, that could be the reason:
Hasn’t been fixed so far