Bhagavad-gītā As It Is · Text 6.42
Spiritual effort is not lost
अथवा योगिनामेव कुले भवति धीमताम् ।
एतद्धि दुर्लभतरं लोके जन्म यदीदृशम् ॥ ४२ ॥
atha vā yoginām eva
kule bhavati dhīmatām
etad dhi durlabha-taraṁ
loke janma yad īdṛśam
Or [if unsuccessful after long practice of yoga] he takes his birth in a family of transcendentalists who are surely great in wisdom. Certainly, such a birth is rare in this world.
Read Śrīla Prabhupāda's purport on Vedabase.io