Why working only on small screen in Unity Editor?

I have a ship which using force to move, and rotate. All working good. I have a code in OnBecameInvisible() method which must transfer ship to oposite screen if he became invisible and situated in given coordinates. All working ifi play game in Unity editor in small creen. And don’t working when i play game build or play using “maximize and play”. Why this happened?

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

public class Ship : MonoBehaviour {

    Rigidbody2D rb;
    Vector2 thrustDirection;

    const float ThrustForce = 1f;
    const float RotateDegreesPerSecond = 15;

    float radius;



    void Start() {
        rb = GetComponent<Rigidbody2D>();
        // thrustDirection(1, 0) make object to move right (because x positive)
        thrustDirection = new Vector2(1, 0);
        radius = GetComponent<CircleCollider2D>().radius;
    }

    private void Update() {
        // calculate rotation amount and apply rotation 
        float rotationInput = Input.GetAxis("Rotate");
        float rotationAmount = RotateDegreesPerSecond * Time.deltaTime;

        if (rotationInput < 0) {
            rotationAmount *= -1;
            rb.transform.Rotate(Vector3.forward, rotationAmount);
            thrustDirection = thrustDirection + new Vector2(Mathf.Cos(rotationAmount * Mathf.Deg2Rad), Mathf.Sin(rotationAmount * Mathf.Deg2Rad));
        } else if (rotationInput > 0) {
            rb.transform.Rotate(Vector3.forward, rotationAmount);
            thrustDirection = thrustDirection + new Vector2(Mathf.Cos(rotationAmount * Mathf.Deg2Rad), Mathf.Sin(rotationAmount * Mathf.Deg2Rad));
        }
    }
    void FixedUpdate() {
        // move ship using thrust force and direction
        if (Input.GetAxis("Thrust") > 0) {
            rb.AddRelativeForce(thrustDirection * ThrustForce, ForceMode2D.Force);
        }
    }

    private void OnBecameInvisible() {

        Vector2 position = transform.position;

        if (position.x - radius > ScreenUtils.ScreenRight) {
            transform.position = new Vector2(ScreenUtils.ScreenLeft, transform.position.y);
        } else if (position.x - radius < ScreenUtils.ScreenLeft) {
            transform.position = new Vector2(ScreenUtils.ScreenRight, transform.position.y);
        } else if (position.y - radius > ScreenUtils.ScreenTop) {
            transform.position = new Vector2(transform.position.x, ScreenUtils.ScreenBottom);
        } else if (position.y - radius < ScreenUtils.ScreenBottom) {
            transform.position = new Vector2(transform.position.x, ScreenUtils.ScreenTop);
        }
    }
}

ScreenUtils class

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

/// <summary>
/// Provides screen utilities
/// </summary>
public static class ScreenUtils {
    #region Fields

    // cached for efficient boundary checking
    static float screenLeft;
    static float screenRight;
    static float screenTop;
    static float screenBottom;

    #endregion

    #region Properties

    /// <summary>
    /// Gets the left edge of the screen in world coordinates
    /// </summary>
    /// <value>left edge of the screen</value>
    public static float ScreenLeft {
        get { return screenLeft; }
    }

    /// <summary>
    /// Gets the right edge of the screen in world coordinates
    /// </summary>
    /// <value>right edge of the screen</value>
    public static float ScreenRight {
        get { return screenRight; }
    }

    /// <summary>
    /// Gets the top edge of the screen in world coordinates
    /// </summary>
    /// <value>top edge of the screen</value>
    public static float ScreenTop {
        get { return screenTop; }
    }

    /// <summary>
    /// Gets the bottom edge of the screen in world coordinates
    /// </summary>
    /// <value>bottom edge of the screen</value>
    public static float ScreenBottom {
        get { return screenBottom; }
    }

    #endregion

    #region Methods

    /// <summary>
    /// Initializes the screen utilities
    /// </summary>
    public static void Initialize() {
        // save screen edges in world coordinates
        float screenZ = -Camera.main.transform.position.z;
        Vector3 lowerLeftCornerScreen = new Vector3(0, 0, screenZ);
        Vector3 upperRightCornerScreen = new Vector3(
          Screen.width, Screen.height, screenZ);
        Vector3 lowerLeftCornerWorld =
          Camera.main.ScreenToWorldPoint(lowerLeftCornerScreen);
        Vector3 upperRightCornerWorld =
          Camera.main.ScreenToWorldPoint(upperRightCornerScreen);
        screenLeft = lowerLeftCornerWorld.x;
        screenRight = upperRightCornerWorld.x;
        screenTop = upperRightCornerWorld.y;
        screenBottom = lowerLeftCornerWorld.y;
    }

    #endregion
}

GameInitializer class attached to main camera

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

/// <summary>
/// Initializes the game
/// </summary>
public class GameInitializer : MonoBehaviour {
    /// <summary>
    /// Awake is called before Start
    /// </summary>
    void Awake() {
        // initialize screen utils
        ScreenUtils.Initialize();
    }
}

You save your screen edges in world space only when you start the game.
When you change the size of your screen, the world space edges change but you don’t update them.

Try starting the game while the game view is already full screen. If that works, you have found the problem.