Hi, Yercik
Looked at your XML, Nothing jumped out as being wrong.
As you stated "When the machine go to home, spindle starts. Any input ((home switch or emergency) activates outputs)."
If you press the E-Stop and your spindle turns ON then there is a logic Issue, Sounds like your spindle and Toolchanger relays power needs to be wired
through NO side then configure the ActiveLow Logic "X or Check."
When the E-stop/Reset is Red the Outputs Leds turn off, The logic state doesn't effect the output led flashing.
So with E-stop/Reset is flashing Red your spindle should be OFF, Then with it Reset/Green the outputs will be off untill you issue a M3 On and M5 Off.
Maybe I've missed something hear.
Hope this Helps, Chip