Leaving a teacher
The suttas give tests for a teacher rather than a vow to one: check what a teaching produces in your own life, and check what can be seen and heard of the teacher's conduct for any sign of corruption. They also give the Buddha's own words that after him the teaching and training would be the teacher, which puts the weight on the practice rather than on any one person. None of that makes leaving easy when there is gratitude and history. The speech teachings apply to how you tell them: what is true and useful, at a time they can hear it. If you are leaving because of harm, that is a different situation and a serious one.
What the suttas say
don’t go by oral transmission, don’t go by lineage, don’t go by testament, don’t go by canonical authority, don’t rely on logic, don’t rely on inference, don’t go by reasoned train of thought, don’t go by the acceptance of a view after deliberation, don’t go by the appearance of competence, and don’t think “The ascetic is our respected teacher.” But when you know for yourselves:
The Kālāma discourse — the canon's charter for testing teachings.
Where this stops: It is not permission to believe whatever one likes; it ends with what the wise praise. Never a reason to stay with a teacher who is doing harm.
AN 3.65:25.3–25.4 · With the Kālāmas of Kesamutta
Mā anussavena, mā paramparāya, mā itikirāya, mā piṭakasampadānena, mā takkahetu, mā nayahetu, mā ākāraparivitakkena, mā diṭṭhinijjhānakkhantiyā, mā bhabbarūpatāya, mā samaṇo no garūti. Yadā tumhe kālāmā attanāva jāneyyātha:
Mendicants, a mendicant who is an inquirer, unable to encompass another’s mind, should scrutinize the Realized One for two things—things that can be seen and heard: ‘Can anything corrupt be seen or heard in the Realized One or not?’ Scrutinizing him they find that nothing corrupt can be seen or heard in the Realized One.
The Buddha's own instructions for scrutinizing a teacher, including himself.
Where this stops: Never a reason to stay with a teacher who is doing harm.
MN 47:4.1–4.4 · The Inquirer
Vīmaṁsakena, bhikkhave, bhikkhunā parassa cetopariyāyaṁ ajānantena dvīsu dhammesu tathāgato samannesitabbo cakkhusotaviññeyyesu dhammesu: ‘ye saṅkiliṭṭhā cakkhusotaviññeyyā dhammā, saṁvijjanti vā te tathāgatassa no vā’ti? Tamenaṁ samannesamāno evaṁ jānāti: ‘ye saṅkiliṭṭhā cakkhusotaviññeyyā dhammā, na te tathāgatassa saṁvijjantī’ti.
Now, Ānanda, some of you might think: ‘The teacher’s dispensation has passed. Now we have no Teacher.’ But you should not see it like this. The teaching and training that I have taught and pointed out for you shall be your Teacher after my passing.
The Buddha's own answer to the fear of losing a teacher — the teaching and the training are the teacher that remains.
Where this stops: Said by the Buddha of himself, at the end of his life, to his monks; it is not a judgement that living teachers are unnecessary. Never a reason to look past a teacher's harm or stay quiet about it.
DN 16:6.1.2–6.1.5 · The Great Discourse on the Buddha’s Extinguishment
siyā kho panānanda, tumhākaṁ evamassa: ‘atītasatthukaṁ pāvacanaṁ, natthi no satthā’ti. Na kho panetaṁ, ānanda, evaṁ daṭṭhabbaṁ. Yo vo, ānanda, mayā dhammo ca vinayo ca desito paññatto, so vo mamaccayena satthā.
“In the same way, prince, the Realized One does not utter speech that he knows to be untrue, false, and pointless, and which is disliked by others. The Realized One does not utter speech that he knows to be true and correct, but which is harmful and disliked by others. The Realized One knows the right time to speak so as to explain what he knows to be true, correct, and beneficial, but which is disliked by others. The Realized One does not utter speech that he knows to be untrue, false, and pointless, but which is liked by others. The Realized One does not utter speech that he knows to be true and correct, but which is harmful, even if it is liked by others. The Realized One knows the right time to speak so as to explain what he knows to be true, correct, and beneficial, and which is liked by others. Why is that? Because the Realized One has sympathy for sentient beings.”
Prince Abhaya — the test for whether and when to say a hard thing.
Where this stops: For deciding whether and when to say one particular hard thing; it does not judge a relationship as a whole, and it is not a reason to say nothing. Nor does it mean anyone owes another person news about their own body, health or pregnancy, or should speak when speaking would put them at risk.
MN 58:8.1–8.8 · With Prince Abhaya
“Evameva kho, rājakumāra, yaṁ tathāgato vācaṁ jānāti abhūtaṁ atacchaṁ anatthasaṁhitaṁ sā ca paresaṁ appiyā amanāpā, na taṁ tathāgato vācaṁ bhāsati. Yampi tathāgato vācaṁ jānāti bhūtaṁ tacchaṁ anatthasaṁhitaṁ sā ca paresaṁ appiyā amanāpā, tampi tathāgato vācaṁ na bhāsati. Yañca kho tathāgato vācaṁ jānāti bhūtaṁ tacchaṁ atthasaṁhitaṁ sā ca paresaṁ appiyā amanāpā, tatra kālaññū tathāgato hoti tassā vācāya veyyākaraṇāya. Yaṁ tathāgato vācaṁ jānāti abhūtaṁ atacchaṁ anatthasaṁhitaṁ sā ca paresaṁ piyā manāpā, na taṁ tathāgato vācaṁ bhāsati. Yampi tathāgato vācaṁ jānāti bhūtaṁ tacchaṁ anatthasaṁhitaṁ sā ca paresaṁ piyā manāpā tampi tathāgato vācaṁ na bhāsati. Yañca tathāgato vācaṁ jānāti bhūtaṁ tacchaṁ atthasaṁhitaṁ sā ca paresaṁ piyā manāpā, tatra kālaññū tathāgato hoti tassā vācāya veyyākaraṇāya. Taṁ kissa hetu? Atthi, rājakumāra, tathāgatassa sattesu anukampā”ti.
Mendicants, these four things can be known in four situations. What four? You can get to know a person’s ethics by living with them. But only after a long time, not casually; only when attentive, not when inattentive; and only by the wise, not the witless. You can get to know a person’s purity by dealing with them. … You can get to know a person’s resilience in times of trouble. … You can get to know a person’s wisdom by discussion. But only after a long time, not casually; only when attentive, not when inattentive; and only by the wise, not the witless.
How a person is actually known — over a long time, with attention, from close up — a standard that applies to a teacher as much as to anyone.
Where this stops: It counsels patience before trusting and before condemning; it is not a reason to stay close to someone already known to be doing harm.
AN 4.192:1.1–1.6 · Facts
Cattārimāni, bhikkhave, ṭhānāni catūhi ṭhānehi veditabbāni. Katamāni cattāri? Saṁvāsena, bhikkhave, sīlaṁ veditabbaṁ, tañca kho dīghena addhunā, na ittaraṁ; manasikarotā, no amanasikarotā; paññavatā, no duppaññena. Saṁvohārena, bhikkhave, soceyyaṁ veditabbaṁ, tañca kho dīghena addhunā, na ittaraṁ; manasikarotā, no amanasikarotā; paññavatā, no duppaññena. Āpadāsu, bhikkhave, thāmo veditabbo, so ca kho dīghena addhunā, na ittaraṁ; manasikarotā, no amanasikarotā; paññavatā, no duppaññena. Sākacchāya, bhikkhave, paññā veditabbā, sā ca kho dīghena addhunā, na ittaraṁ; manasikarotā, no amanasikarotā; paññavatā, no duppaññenāti.