Hi,
As detailed in the Scripting API documention found at https://docs.unity3d.com/ScriptReference/Tilemaps.Tilemap.GetTilesRangeNonAlloc.html, GetTilesRangeNonAlloc will begin at the given starting position and iterate through all available Z Positions, then through the X and Y positions until it reaches the ending position. This will scan all X positions above the start position up to the end position, which can be outside of given X values (see example at the bottom in Scripting API documentation).
If you want to get Tiles within the bounds, please use Tilemap.GetTilesBlockNonAlloc instead (https://docs.unity3d.com/ScriptReference/Tilemaps.Tilemap.GetTilesBlockNonAlloc.html).