This is the case with azerite beam and also the rustbolt trinket as they have 2 cast times. There is an initial cast followed by a channel; it is in between this transition from pre cast to channel is when it is interrupted by your next move queued up in the macro you are running.
The only way I have found to prevent the interupt is by having focus beam or the trinket use on a modifier which when held until the channel time is completed prevents interruption.
I cannot get modifiers to work for me in macros; there is an exteral keybinding not in wow (as I have removed all known bindings in wow) allocated to my cntrl, shift and alt buttons so I get around this in a very lazy way my main sequence the macro I set to the number 3 I then allocate moves that should be on modifiers if they worked for me to shift-3 alt-3 and cntrl-3, for example my eye beam is on cntrl 3 and my azerite beam is alt3 works like a charm