The Home Key was not longer working, Recent/Back Key was not working too, the Notification Bar could not be swiped down. I experienced this problem on my Xiaomi Mi A1 phone after I messed-up something. The origin of the problem may have been an update with the switching from A to B boot partition. The Google Play Store did not worked properly, preventing from installing new applications, even the Developer options (from Settings ⇒ System) were not longer working due the error Developer options are not available for this user.
Clearly some settings were messed-up, but it was not clear how to solve the problem. Fortunately I found a procedure that fixed the problem, without a factory reset.
The trick is to run the SetupWizardUpgradeActivity from the com.google.android.setupwizard app. The app may have different names upon localization, e.g. Setup Wizard for English or Configurazione Android for an Italian version.
A common recipe is to install the Nova Launcher app, which has a widget capable of starting an app activity, directly (see below for an alternative). Unfortunately the Google Play Store was not working too, so I had to relay on some other method to download the apk file. Actually I tried the apkleecher.com and apps.evozi.com services, which turned out to provide the very same contents into the apk archives, despite the archives itself had different checksums.
So I downloaded the Nova Launcher apk on the PC and transferred it to the phone via the adb push command. Then I had to allow unknown sources permission to the file manager app.
A preferable alternative to installing Nova Launcher, is to install Activity Launcher (available from F-Droid). This application does just what is required: add a widget to launch an app activity.