That is because of physical difference between QWERTY and QWERTZ layouts, so this has messed up your layout.
Anyway, there is a layout setting in Lineage OS, try to switch it to the other option.
I think it will be good or even worse depending on these layouts.