The following verse is found in the Kātyāyana-saṁhitā (Hari-bhakti-vilāsa 10.295, Bhakti Rasamrita Sindhu 1.2.111)—
I would rather be locked in a cage surrounded by burning flames than suffer in the association of those who dislike thinking of Krishna. And a similar idea is found in the Viṣṇu-rahasya (BRS 1.2.112)–
āliṅganaṁ varaṁ manye
na saṅgaḥ śalya-yuktānāṁ
I believe it is better to embrace a poison snake, a tiger—which will eat you up--or a crocodile—which will swallow you up--rather than accept the painful companionship of someone who worships many gods and not the Supreme Lord.
agnite paṛi vā pañjarete baddha hai
tabu kṛṣṇa-bahirmukha-saṅga nāhi lai
varaṁ sarpa-vyāghra-kumbhīrera āliṅgana
anya-sevi-saṅga nāhi kari kadācana
I would rather fall into a fire or be imprisoned in a cage, as long as I do not fall into the company of those who reject Krishna.
I would rather embrace a serpent, tiger or alligator than ever associate with those who serve someone other than Krishna.