Emissive moon shows through masked branches when behind clouds

Quite specific, but I’ve tried everything.

Here is the moon showing whilst behind the tree branches (not supposed to show):
image

Here is the moon when not behind the branches (blocked by clouds):
image

My problem is, the moon is obstructed by the clouds, but when you look through a masked material (such as the tree branches) the moon in showing through the clouds and through the branch. I don’t understand why this happens or how to fix it.

Here is a sort of inbetween:
image

Any clues on how to solve this mystery?

The moon is emissive, the clouds are just the standard volumetric clouds, the branches are masked.

Thanks scooby gang

Is your moon a mesh (sphere)?

Hi, yes it is

Bump