How to finish State Tree Task?

There is a bug (in 5.1) that meant that the on completion does not work properly. See here: State Trees and transition on completion - #3 by Light_Shock