A small update:
I now went to control center to set numlock to be turned on whenever I log in to KDE. After this, the [Keyboard] section appeared again to my kcminputrc and login failed the same way again. Now that I had identified the file causing the issue, I did line-by-line editing on the file and noticed that the cause of unsuccessful login was the line saying "NumLock=0". When I removed that from kcminputrc, I could succesfully login again.