Might be hardware problem, not sure. In that case, mine is moto g5 (on lineage 14.1)
Occasionally when the phone sleeps and I press power button nothing happens. Requires pressing it 4-5 times to wake it up.
In other cases, again sometimes, when it is awake and I want to blacken/lock the screen, again pressing power button once does not do anything. Long press invokes the restart-poweroff-whatever menu. I need to really struggle to persuade it to go asleep.
Found some similar complaints from older times with other phones, but no clear explanations.
Does anybody have experience of dealing with this problem?