Why wouldn’t this work?
Because the reference is invalid and/or the cast fails due to incorrect type. Or the whole chain is triggered incorrectly. We will never know without more info.
You call the “cube2” blueprint right after you started play the sound. If your player doesn’t touch the cube right in this moment, your reply of the “cube2”-blueprint will be “false”.
I think you have a collision inside the cube-blueprint and check the collision? Than you should call an event to stop the sound. Even if the “OnOverlap”-Event fires inside the cube-blueprint, your “play-sound-blueprint” doesn’t know that. So you have to set up an event dispatcher inside the cube blueprint or set up an interface to receive the event inside the player-blueprint.
A possible solution could be also to stop the sound right inside the cube-blueprint.
An easy, but very bad, solution would also be to put the “cast to”, branch and stop node behind the “Event Tick” node. But this will make the blueprint call every tick (frame) which could last into a bad performance.