Only one object has bloom when Z combining

I have some trouble in the compositor and I need help. I made this super simple scene to demonstrate the problem:


Then what I did is render out the cube and the sphere separately into two images with transparent backgrounds. I used OpenEXR format with Z buffer enabled, and I connected the depth value of the render layer to the Z socket of the composite node. (Though I don’t need depth values in this example, I do in my actual project.)

Then I Z combined the two images and also rendered out the floor plane and put the two objects on top of it with an alpha over node: (It is necessary to have a non-alpha background to get the bloom to show at all.)


An now you see the problem, only one object shows the bloom effect. If I swap around the image and Z values of the two objects, the bloom swaps as well for some reason:


Also, with the colors set to black and white, you can see only one object is visible at a time:


I am absolutely unsure about what causes this behavior, by all means it should work in my opinion, both objects should have bloom no matter in what order they’re combined, but they don’t. If you know a solution to this, please let me know!

(note: this has been copied over from blender stack exchange where I originally asked this question)

I found an answer thanks to a commenter. You can check it out over at the original question at stack overflow.