[Moto G5S  Questions & Answers] phileva:
I by now means am any kind of expert with this. I too, am learning this on the fly, and only been at this a few days. But I will try to give some advice. (most will be useless advice because Im not 100% on my own experiances even now)

First, again, im not 100%, you may of messed up your OS totally. I have experiance reinstalling my OS from scratch. I have a moto g5s plus sanders phone. 7.1.1 nougat. I went through hell trying to flash my OEM rom. Finding it was a pain, installing it was even more of a pain. Now what monstly, not entirely worked was: --youtube.com/watch?v=-FszZOx2pWU for reflashing.

Also, --xda-developers.com/moto-g5s-plus/development/flash-official-firmware-moto-g5s-plus-t3681018 has some advice to reflash. Now I dont know at all if this is useful for you or not, im sorry :( The key for reflashing for me was the ADB fastboot files FINDING the right rom. The commands with the xda link...the ones that started with "m" dont work for me. I had to use the youtube commands. Now for me, this was VERY important, TO RELOCK YOUR PHONE. The command to "fastboot oem lock" was a must! If I didnt enable that I too got the message of bad key and never could load into TWRP. I had to reinstall my OEM rom AND relock the phone. Then go through the process again to root. Before rooting your phone, I hightly suggest you get an OS working either custom or original. And relock the phone in the process. That is key, relock the phone, dont keep it unlocked. At least for ME that was true.

Now shouldnt be to hard to find your OEM rom. (im not good enough for custom ROM'ing yet) Then again if its a germany specific phone might be hard. Again im sorry, I dont know.

Now as for the bad key. I too had much experiance with this, that I cant exactly explain how I overcame it. Basically I think youre not installing TWRP correctly that is the bad key message youre getting, i "think" the message should say "N/A" instead, Im not 100%! Once you install ur choice of root'ing (I prefer supersu over magisk. Both work) boot into recovery and install TWRP. If you have the root program of your choice installed install it now. Dont reboot, just load TWRP and install immediately. Now if you cant find your rooting program because you wiped it, didnt transfer it, whatever. You have to do that first. You must, must install root program first. I have a backup sd micro card, I had to format that PORTABLE NOT INTERNAL. With it being internal I had to many problems of apps not working correctly. It being portable made it easier to do anything. So "if" you need to reflash do so. Put root program on your phone however method you choose. I use MTP and install the .zips in both local and external memory.

Go into recovery, load TWRP..."fastboot flash recovery xxxxxxxxxxxxxx.img". Then boot into twrp with "fastboot boot xxxxxxxxxxxxx.img". Or just volume keys into recovery mode. Swipe to allow modifications (i hear that can be a bad thing if you do NOT have ur root program saved on the phone, I dont know) And find the zip and install. Youre done.

I hope this was a little help. If even a little of it is relevant, Im glad. Otherwise sorry that I couldnt help more!