There are many similar questions on SO, but most of them are related to -i behavior that is different between platforms, so this is different.
In this case, the problem is quite simple: it seems that label references can only be returned in the BSD sed version, while the GNU version allows direct links. That is, on MacOS,: :label should appear before b label .
The solution is to rewrite the expression either to define the label in front of the branch, or in the case of the expression above to implement the branch - it's kind of "if this template is missing ... jump forward". In this case, the expression can be expanded so as not to require a label in the first place:
sed '/SUCCESSFUL/d ; /\s+\[java\]\s*/d; /\[java\]/s/\s\+\[java\]//; /Compiling/!d; /^\s*$$/d; s/^/monitor: /'
ralfoide
source share