How do I make Bluetooth headphones disconnect automatically when I put them back in their box?

I’ve anker soundcore liberty neo Bluetooth earphones that stay connected to phone even when I put them back in their charging bix

The earbuds should disconnect when they are placed back in the case. It’s possible the charging pins require cleaning in the case or on the earbuds. Have you noticed any charging issues recently?

Are we talking popped back in for seconds, OR still playing minutes later?

If just a micro second, it may not have registered.

If minutes (plus) turn, as @ndalby says, it’s time to clean.

If this is from NEW, have you removed the film? I know some need a film removing before use.