iPhone's power button doesn't lock, shows Swipe to Power Off instead
The button seems to have fixed itself. I used assistive touch to lock it 


Locking an iPhone if button is broken?


and kept checking if power button is working or not. Often it shows the swipe to power off screen, but that's okay. Somehow battery capacity became 84%.