The issue was with this piece of code, now it works just perfect.
private void StateMachine()
{
horizontalInput = Input.GetAxisRaw("Horizontal");
verticalInput = Input.GetAxisRaw("Vertical");
if((wallLeft || wallRight) && verticalInput > 0 && AboveGround())
{
if (!pm.wallrunning)
{
StartWallRun();
}
}
else
{
if (pm.wallrunning)
{
StopWallRun();
}
}
}