When you do a castrandom it randomly picks one of your 5 spells.

So just because only one isn't on cooldown, doesn't mean that one will be automatically picked.

So you need to spam the button on average 5 times to get the last one to trigger.

So you could hit the button 5 times and it could pick abilities that are all on CD, so it looks like it's doing nothing, which it is.

Then again, you could hit it 5 times and it might pick the abilities that are all available and it'll work great.

The solution is just spam the macro faster!