Unity Tilemap own specific Rule Tile

Hello,
I am making a 2D game in unity and I tried to make my own Rule Tile.

I saw this video and got a little bit inspired by it (I don’t need exactly what the video shows, but I got general idea.

I am trying to make a Tiling Rule, which detects, if the tile is from one of 4 arrays (for now every array has just 1 tile).

The tiling rules look like this - you can see the 4 arrays (there is 1 tile in every for now) and then the tiling rules (I added them own icons to better recognize them - like in the video) - B is from the Bottom Wall array, R from Right Wall array etc. so when there is bottom wall at the top, right wall on the left, left wall on the right and top wall on the bottom this completly empty room should spawn, however it doesn’t. (Sprites are assigned into the Tiling rules and tiles (the ones you get when you drag the sprite into tile palette) are in the arrays).

The first rule isn’t used, the rule below is, even though the situation of the first tilling rule happened. Here you can see the exact situation - changing the order of the rules don’t work, the specific one must be obviously first

In the code there are also rules that the room should NOT have a top/bottom/… wall, which doesn’t work either.

Finally, here is the script

    using UnityEngine;
    using UnityEngine.Tilemaps;
    using System.Linq;
    using System;
    
    [CreateAssetMenu(menuName = "VinTools/Custom Tiles/Advanced Rule Tile")]
    public class AdvancedRuleTile : RuleTile<AdvancedRuleTile.Neighbor>
    {
        [Header("Advanced Tile")]
        [Tooltip("If enabled, the tile will connect to these tiles too when the mode is set to \"This\"")]
        public bool alwaysConnect;
        [Tooltip("Tiles to connect to")]
        public TileBase[] tilesToConnect;
    
        public TileBase[] topWall;
        public TileBase[] bottomWall;
        public TileBase[] leftWall;
        public TileBase[] rightWall;
        public TileBase[] noWall;
    
        [Space]
        [Tooltip("Check itseft when the mode is set to \"any\"")]
        public bool checkSelf = true;
    
        public class Neighbor : RuleTile.TilingRule.Neighbor
        {
            public const int Any = 3;
            public const int Nothing = 4;
    
            public const int topWall = 5;
            public const int bottomWall = 6;
            public const int leftWall = 7;
            public const int rightWall = 8;
    
            
            public const int notTopWall = 9;
            public const int notBottomWall = 10;
            public const int notLeftWall = 11;
            public const int notRightWall = 12;
    
        }
    
        public override bool RuleMatch(int neighbor, TileBase tile)
        {
            switch (neighbor)
            {
                case Neighbor.This: return Check_This(tile);
                case Neighbor.NotThis: return Check_NotThis(tile);
                case Neighbor.Any: return Check_Any(tile);
                case Neighbor.Nothing: return Check_Nothing(tile);
    
                case Neighbor.topWall: return Check_topWall(tile);
                case Neighbor.bottomWall: return Check_bottomWall(tile);
                case Neighbor.leftWall: return Check_leftWall(tile);
                case Neighbor.rightWall: return Check_rightWall(tile);
    
               
                case Neighbor.notTopWall: return Check_notTopWall(tile);
                case Neighbor.notBottomWall: return Check_notBottomWall(tile);
                case Neighbor.notLeftWall: return Check_notLeftWall(tile);
                case Neighbor.notRightWall: return Check_notRightWall(tile);
    
            }
            return base.RuleMatch(neighbor, tile);
        }
    
        /// <summary>
        /// Returns true if the tile is this, or if the tile is one of the tiles specified if always connect is enabled.
        /// </summary>
        /// <param name="tile">Neighboring tile to compare to</param>
        /// <returns></returns>
        bool Check_This(TileBase tile)
        {
            if (!alwaysConnect) return tile == this;
            else return tilesToConnect.Contains(tile) || tile == this;
    
            //.Contains requires "using System.Linq;"
        }
    
        /// <summary>
        /// Returns true if the tile is not this.
        /// </summary>
        /// <param name="tile">Neighboring tile to compare to</param>
        /// <returns></returns>
        bool Check_NotThis(TileBase tile)
        {
            if (!alwaysConnect) return tile != this;
            else return !tilesToConnect.Contains(tile) && tile != this;
    
            //.Contains requires "using System.Linq;"
        }
    
        /// <summary>
        /// Return true if the tile is not empty, or not this if the check self option is disabled.
        /// </summary>
        /// <param name="tile">Neighboring tile to compare to</param>
        /// <returns></returns>
        bool Check_Any(TileBase tile)
        {
            if (checkSelf) return tile != null;
            else return tile != null && tile != this;
        }
    
    
        /// <summary>
        /// Returns true if the tile is empty.
        /// </summary>
        /// <param name="tile">Neighboring tile to compare to</param>
        /// <param name="tile"></param>
        /// <returns></returns>
        bool Check_Nothing(TileBase tile)
        {
            return tile == null;
        }
    
        /// <summary>
        /// Returns true if the tile is one of the specified tiles.
        /// </summary>
        /// <param name="tile">Neighboring tile to compare to</param>
        /// <returns></returns>
        
    
        //YES
        bool Check_topWall(TileBase tile)
        {
            return topWall.Contains(tile);
        }
    
        bool Check_bottomWall(TileBase tile)
        {
    
            return bottomWall.Contains(tile);
        }
    
        bool Check_leftWall(TileBase tile)
        {
    
            return leftWall.Contains(tile);
        }
    
        bool Check_rightWall(TileBase tile)
        {
    
            return rightWall.Contains(tile);
        }
    
    
        // NOT
        bool Check_notTopWall(TileBase tile)
        {
    
            return tile != topWall.Contains(tile);
        }
    
        bool Check_notBottomWall(TileBase tile)
        {
    
            return tile != bottomWall.Contains(tile);
        }
    
        bool Check_notLeftWall(TileBase tile)
        {
    
            return tile != leftWall.Contains(tile);
        }
    
        bool Check_notRightWall(TileBase tile)
        {
    
            return tile != rightWall.Contains(tile);
        }
        
    }

I checked really big amount of topics and questions and didn’t find anything.
Is there somebody, who can help me?

Thanks