Turn light off based on timer

I will give up. Actually I have the problem that the timer switches the coffee maker after a random time off, but inside the time range of the set timer value. To reduce the failure possibilities I simplify the rule to:

rule "Kaffeemaschine auto off"
when
    Item Wallplug1_Switch changed
then
    if (Wallplug1_Switch.state==OFF) {
        myTimer_Kaffeemaschine.cancel
        myTimer_Kaffeemaschine = null
        logInfo("rules","Timer Kaffeemaschine cancelled")
    }
    else if (Wallplug1_Switch.state==ON) {
        	logInfo("rules","Timer Kaffeemaschine start and set to: "+minutes_auto_off_kaffee.state+" minutes")}
       		myTimer_Kaffeemaschine = createTimer(now.plusMinutes((minutes_auto_off_kaffee.state as DecimalType).intValue)) [|
            sendCommand(Wallplug1_Switch, OFF)
        ]
end

But the problem still exists. Sometimes it happens, that the log shows a state change, but the reale plug doesn’t change the state, but I don’ t have any connection issues with the z-wave plug. Every second or third try the timer operates correct.

Actually I have no imports inside my rules file.

Can somebody help me please!