Transform is skipping

I am using two buttons(Left and right) to transfer between what will be rooms but I have an issue. Works fine when I enter the Red/blue room but when trying to re enter the green room from either room it is skipped and and you are shown the opposite side. Below is my code so if anyone could help it would be appreciated!

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class roomChange : MonoBehaviour
{
    public GameObject leftRoom; //Red
    public GameObject rightRoom; //Green
    public GameObject shop; //Blue

    public bool inshop;
    public bool inLeft;
    public bool inRight;

    public Vector3 shopPos;
    public Vector3 LeftPos;
    public Vector3 RightPos;

    void Start()
    {
        UnityEngine.UI.Button LButton = GameObject.Find("ButtonL").GetComponent<UnityEngine.UI.Button>();
        UnityEngine.UI.Button RButton = GameObject.Find("ButtonR").GetComponent<UnityEngine.UI.Button>();

        shopPos = new Vector3 (-40.84f, 0, -10);
        LeftPos = new Vector3(-19.37f, 0, -10);
        RightPos = new Vector3(18.73f, 0, -10);
    }

    public void Update()
    {
        float horizontal = Input.GetAxis("Horizontal");

        if (horizontal == 0)
        {
            inshop = true;
            inLeft = false;
            inRight = false;
        }
        else if (horizontal == -19.37f)
        {
            inshop = false;
            inLeft = true;
            inRight = false;
        }
        else if (horizontal == 18.73f)
        {
            inshop = false;
            inLeft = false;
            inRight = true;
        }
    }

    public void leftButton()
    {
        if (inshop == true)
        {
            GameObject.Find("Main Camera").transform.position = LeftPos;
        }
        
        if (inRight == true)
        {
            GameObject.Find("Main Camera").transform.position = shopPos;
        }
    }

    public void rightButton()
    {
        if (inshop == true)
        {
            GameObject.Find("Main Camera").transform.position = RightPos;
        }

        if (inLeft == true)
        {
            GameObject.Find("Main Camera").transform.position = shopPos;
        }
    }  
}

I think the error comes from you misunderstanding what Input.GetAxis("Horizontal") is, it doesn’t return where “you” are in the scene, it has no idea about what’s going on in your game, all it does is give you if and how certain buttons are pressed , no more no less (well i am simplfying here).
I think the docs do a good job explaining how GetAxis works, check it out.
As for the solution, i think this should work.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class roomChange : MonoBehaviour
{
    public GameObject leftRoom; //Red
    public GameObject rightRoom; //Green
    public GameObject shop; //Blue

    public bool inshop;
    public bool inLeft;
    public bool inRight;

    public Vector3 shopPos;
    public Vector3 LeftPos;
    public Vector3 RightPos;
    public GameObject camera;
    void Start()
    {
        UnityEngine.UI.Button LButton = GameObject.Find("ButtonL").GetComponent<UnityEngine.UI.Button>();
        UnityEngine.UI.Button RButton = GameObject.Find("ButtonR").GetComponent<UnityEngine.UI.Button>();

        // since you're already caching stuff in fields , cache the camera also instead of re-fetching the camera everytime in the subsequent code
        camera = GameObject.Find("Main Camera");

        shopPos = new Vector3 (-40.84f, 0, -10);
        LeftPos = new Vector3(-19.37f, 0, -10);
        RightPos = new Vector3(18.73f, 0, -10);

        // initial the camera position
        camera.transform.position = shopPos:
        inshop = true;
        inLeft = false;
        inRight = false;
    }

    public void Update()
    {
        // i changed this to GetAxisRaw since it doesn't look like you need "smoothed" input
        // check the docs for more info and to understand the difference
       // "horizontal" will be either -1 , 0 or 1
        float horizontal = Input.GetAxisRaw("Horizontal");

        if (horizontal < 0)
           leftButton();
        else if (horizontal > 0)
           rightButton();
    }

    public void leftButton()
    {
        if (inshop)
        {
            camera.transform.position = LeftPos;
            inshop = false;
            inLeft = true;
            inRight = false;
        }
        
        if (inRight)
        {
            camera.transform.position = shopPos;
            inshop = true;
            inLeft = false;
            inRight = false;
        }
    }

    public void rightButton()
    {
        if (inshop)
        {
            camera.transform.position = RightPos;
            inshop = false;
            inLeft = false;
            inRight = true;
        }

        if (inLeft)
        {
            camera.transform.position = shopPos;
            inshop = true;
            inLeft = false;
            inRight = false;
        }
    }  
}