Varna system is always birth based, it was never based on the character or abilities of a person.
In which varna a person will take birth it depends his previous life activities
Proof from Vedic religion scriptures.
Chandyog upanishad 5.10.7
Manusmriti 2.31–2.32 explains how names will be given to New born baby according to his or her varna
These verses describe how a child should be named according to varṇa.
Manusmriti 2.31 – Mentions that the name should be given on the 10th or 12th day after birth (or on an auspicious day).
Manusmriti 2.32 – Specifically talks about naming according to varṇa:
A Brāhmaṇa’s name should express auspiciousness.
A Kṣatriya’s name should express power and protection.
A Vaiśya’s name should express wealth and prosperity.
A Śūdra’s name should express service.
Mahabharata Book 13 anushasan parva section 27 and 28 talk about Rishi matang who was actually chandala by birth because he is born to shudra father and bhraman mother.
Mahabharat book 13 anushasan section 48 explains how child varna depends upon parents varna
All these knowledge are given by bishma before his death after kurukshetra war, bishma given these knowledge to yudhishtir on the the request of Krishna, according to Krishna bishma was very knowledge full person, his knowledge will clear confusion of yudhishthir who was upset because he won war by killing his relatives. you can read this thing in Mahabharata Book 12 Shanti parva section 51 and 52.
Vidur who was minister of kuru kingdom, denied to give high level knowledge when king asked to him, he said iam shudra by birth iam not eligible to give high level knowledge to anyone.
Sanat-sujata Parva
SECTION 51
Dhritarashtra said, 'Dost thou not know what that immortal Rishi will say unto me? O Vidura, do thou say it, if indeed, thou hast that degree of wisdom.'
"Vidura said, 'I am born in the Sudra order and, therefore, do not venture to say more than what I have already said. The understanding, however, of that Rishi leading a life of celibacy, is regarded by me to be infinite. He that is a Brahmana by birth, by discoursing on even the profoundest mysteries, never incureth the censure of the gods. It is for this alone that I do not discourse to thee, upon the subject.
In Bhagavad Gita 1.40 Verse arjun show his tension about varan shankar child ( child born from inter mixing of different varna
Adharmābhibhavāt Kṛṣṇa
Praduṣyanti kula-striyaḥ
Strīṣu duṣṭāsu Vārṣṇeya
Jāyate varṇa-saṅkaraḥ
Meaning:
When irreligion (adharma) prevails, O Krishna, the women of the family become corrupted.
When women are corrupted, O descendant of Vrishni, varna-saṅkara.
Krishna also accept that inter mixing varna is dangerous for human race in bagvath Gita 3.24
Bhagavad Gita 3.24
Transliteration:
Utsīdeyur ime lokā
Na kuryāṁ karma ced aham
Saṅkarasya cha kartā syām
Upahanyām imāḥ prajāḥ
Meaning:
If I did not perform action,
these worlds would perish.
I would be the cause of social disorder (saṅkara),
and I would destroy these beings.
Krishna in bagvath Gita Verse 3.35 and 18.47 said that , it is better do you your down duty even though it is done imperfectly rather than doing others duty perfectly.
In bagvath Gita Verse 18.48 Krishna says you can't leave your duty which is decided by your birth, even though you don't like it
Last but not the least, bagvath Gita Verse 4.13 the most Miss interrupted Verse by many people to prove varna is by quality not by birth.
chātur-varṇyaṁ mayā sṛiṣhṭaṁ guṇa-karma-vibhāgaśhaḥ
tasya kartāram api māṁ viddhyakartāram avyayam
Chatur varnyam - four varna
Maya srishtam - were created by me.
Guna-karma -Vibhagash - divided by nature of work.
Tasya kartaram api - even though iam the creator
Mam viddhiyakartam avvyam - i cant control and it is unchangeable.
Krishna in this verse is saying that four varna were created by me, the sentence is in past perfect it is means a person varna is already decided.
In the next line he is saying that a person varna is decided by nature of work or quality of work which are three types according to Krishna in bagvath gita. We can read about that three types of nature of work in in chapter 14.
In chapter 14 Krishna is saying how the dominance of three types of quality satav, rajo and thama decides a person next birth.
A person who do his duty without expecting any benefit are satvic. For such person duty is first priority, he don't bother about benefits
A person who do his duty expecting benefit are rajo, for such person benefit is first priority, he do his duty expecting benefits.
A person who is lazy and don't his duty is thama.
So according to the dominance of three types nature of work in a person life before his death, he will born into any four varna in his next birth.
More dominance of satvic quality in the life leads to take birth in upper varna like kshatriya or bhraman in next life
More dominance of qualities like thama in the life leads to take birth in lower varna like shudra or even avarna (out side varna) like chandala in next life.
Varna has been decided always by birth.