I can’t think of an example in the Bundesliga. But in La Liga, Villareal played in the 2011-12 CL group stages and got relegated in the same season.
Schalke was also really close in Bundesliga - they even reached the round of last 16 in spring 2019, and in the end stayed in the league with only 32 points.
Leverkusen hat allerdings auch eine recht unrühmliche Bilanz gegen unterklassige Teams im Pokal. In fünf der letzten sechs Jahre sind sie gegen einen Nicht-Bundesligisten ausgeschieden.