Really great question. Shopify's automatic buy x get y discount doesn't quite have this feature, so you'll need to look elsewhere to get this, such as an app or have something custom made by Shopify Experts.
There are several buy x get y apps in the Shopify App store which you can see here. I looked at some of them and none outright say in the description about the 'y' being added automatically. It could be worth researching and finding one you resonate with.
Last but not least, if you can't find an app to do this, it might require some custom work. For this, I'd recommend a Shopify Expert from the Expert directory to work with on it.
I think you can take a look at ConnectPOS. Our app has a module that implements Buy X get Y promotion and automatically adds product Y to the customer's cart if Y is a free product!
ConnectPOS is a leading POS solution that directly integrates with Shopify, so you can enjoy a seamless and real-time data synchronization between your online and offline stores. Don't hesitate to book a free consultation with us right from today!