As a general rule of thumb, keeping your boundary groups configuration stupid simple is a good idea. That being said, I was today years old when I learned how multiple boundary groups, with different peer download settings, affect Delivery Optimization settings as well as Peer Cache downloads.
TL;DR
Configure your clients to be a member of exactly 1 boundary group and all is good. No need to worry.
Delivery Optimization in ConfigMgr
For the full story on Delivery Optimization in ConfigMgr, read this post https://deploymentresearch.com/setup-delivery-optimization-do-for-configmgr-current-branch/ , but to summarize it: ConfigMgr can configure the DO download mode, set the Group ID, and set the Cache Server to use for all machines having a ConfigMgr client installed.
ConfigMgr uses Client Settings to enable DO setting all together, and the details are coming from the boundary group. For a client to set the DO group ID to the ID of the boundary group, you need to enable peer downloads for the boundary group. This is the same setting you would use to allow Peer Cache Client Settings to be deployed, but also affects Delivery Optimization.

Multiple Boundary Groups
The interesting learning from today is following: If a client is a member of one boundary group that allow peer download, and at the same time, is a member of a boundary group that does not allow it. The result is no DO settings being applied, and the clients reverts to DO download mode 1, and no DO Group ID being set. No entirely ideal for most environments.
Note: Again, the same behavior also affects Peer Cache. If a client is a member of another boundary group, where peer downloads are disabled, it will never download from a peer cache source. Doesn't matter if its first boundary group has it enabled. No means no.


Do you know if the settings are reverted when the client moves out of the second boundary?
I.e. if a laptop is traveling from one location to another, becomes a member of a the new locations boundary group and get new settings, then moves back to it's original location. Is that enough to revert to old (original) settings?
If the client is no longer in the "denying" boundary group you're all good.