RPGStatSystem tutorial problem with clases visibility?

I’m a beginner, I’m watching a series of RPG System Stat tutorials and in lesson 9, when the mentor refactored the project, everything stopped working, he switched to independent classes from MonoBehavior. I downloaded his final project from github, of course the code works. BUT does not work in test scripts, I spent some time and found out that there is a problem with RPGDefaultStat in RPGTestScript. when instantiating RPGDefaultStat we get null why ??? If I directly create a characteristic instead of an instance, let’s say a characteristic, it is created, this interested me incredibly
GitHub - jkpenner/RPGSystemTutorial at StatSystemEndPoint github and http://jkpenner.net/blog/2016/5/30/rpgsystem-09-stats-09-rpgstatcollection-v1
Unity3D: RPG Systems 09: Stats 09 - Finishing RPGStatCollection - YouTube

RPGTestScript
    public class RPGStatTest : MonoBehaviour {
        private RPGStatCollection stats;
    
        public RPGDefaultStats newStats;
    
    	void Start () {
            stats = new RPGDefaultStats();
            //newStats = new RPGStatCollection() as RPGDefaultStats;
            var health = stats.CreateOrGetStat<RPGAttribute>(RPGStatType.Health);
            health.StatName = "health";
            health.StatBaseValue = 10;
    
            var statTypes = Enum.GetValues(typeof(RPGStatType));
            foreach (var statType in statTypes) {
                RPGStat stat = stats.GetStat((RPGStatType)statType);
                if (stat != null) {
                    Debug.Log(string.Format("Stat {0}'s value is {1}",
                        stat.StatName, stat.StatValue));
                }
            }
    
            var health2 = stats.GetStat<RPGStatModifiable>(RPGStatType.Health);
            health2.AddModifier(new RPGStatModBasePercent(1.0f));      // 200
            health2.AddModifier(new RPGStatModBaseAdd(50f));           // 250
            health2.AddModifier(new RPGStatModTotalPercent(1.0f));     // 500
            health2.UpdateModifiers();
    
            foreach (var statType in statTypes) {
                RPGStat stat = stats.GetStat((RPGStatType)statType);
                if (stat != null) {
                    Debug.Log(string.Format("Stat {0}'s value is {1}",
                        stat.StatName, stat.StatValue));
                }
            }
    	}
    
        void ForEachEnum<T>(Action<T> action) {
            if (action != null) {
                var statTypes = Enum.GetValues(typeof(T));
                foreach (var statType in statTypes) {
                    action((T)statType);
                }
            }
        }
    
        void DisplayStatValues() {
            ForEachEnum<RPGStatType>((statType) => {
                RPGStat stat = stats.GetStat((RPGStatType)statType);
                if (stat != null) {
                    Debug.Log(string.Format("Stat {0}'s value is {1}",
                        stat.StatName, stat.StatValue));
                }
            });
        }
    }

RPGDefaultScript

public class RPGDefaultStats : RPGStatCollection {

    protected override void ConfigureStats() {
        PublicConfig();
    }

    public void PublicConfig()
    {
        var stamina = CreateOrGetStat<RPGAttribute>(RPGStatType.Stamina);
        stamina.StatName = "Stamina";
        stamina.StatBaseValue = 10;

        var wisdom = CreateOrGetStat<RPGAttribute>(RPGStatType.Wisdom);
        wisdom.StatName = "Wisdom";
        wisdom.StatBaseValue = 5;

        var health = CreateOrGetStat<RPGVital>(RPGStatType.Health);
        health.StatName = "Health";
        health.StatBaseValue = 100;
        health.AddLinker(new RPGStatLinkerBasic(CreateOrGetStat<RPGAttribute>(RPGStatType.Stamina), 10f));
        health.UpdateLinkers();
        health.SetCurrentValueToMax();

        var mana = CreateOrGetStat<RPGVital>(RPGStatType.Mana);
        mana.StatName = "Mana";
        mana.StatBaseValue = 2000;
        mana.AddLinker(new RPGStatLinkerBasic(CreateOrGetStat<RPGAttribute>(RPGStatType.Wisdom), 50f));
        mana.UpdateLinkers();
        mana.SetCurrentValueToMax();
    }
}

For my creation to work, I changed the visibility from protected in the base creation class to public and in my version from RPGTestScript it is created, but why do we get null when creating an RPGDefaultStat instance ?? how is it possible

if RPGDefaultStat is not a monobehaviour then you can not instantiate it, instantiate is a custom constructor only for monobehaviours and you have to use the new keyword. The new keyword is not used for monobehaviours because they use instantiate. No matter which way you create, it is creating an instance of the class. If it is null that is because the instance was not created or you did not create the reference.