Nokia 6.1 stuck in "Download mode" One day my Nokia 6.1 goes into "Download mode" and rebooting doesn't help.

Flashing TWRP doesn't work:

$ fastboot boot twrp-3.3.1-0-PL2.img 
downloading 'boot.img'...
OKAY [  1.235s]
booting...
FAILED (remote: unlock device to use this command)
finished. total time: 1.236s


Unlocking doesn't work:

$ fastboot oem unlock
...
FAILED (remote: Flashing Unlock is not allowed
)
finished. total time: 0.000s
$ fastboot flashing unlock
...
FAILED (remote: Flashing Unlock is not allowed
)
finished. total time: 0.000s


Repeatedly calling fastboot continue just prints a bunch of system info on my phone screen (e.g. DEVICE STATE = locked).

How do I recover the phone?
Factory reset

For some reason, my device was on slot b:

$ fastboot getvar current-slot
current-slot: b
finished. total time: 0.001s


After changing to slot a,

$ fastboot set_active a
Setting current slot to 'a'...
OKAY [  0.009s]
finished. total time: 0.010s
$ fastboot continue 
resuming boot...
OKAY [  0.319s]
finished. total time: 0.319s


I got a menu offering a factory reset, after which the phone booted into the OS.