I GUESS recieveEvent is called from ISR. If so, you cannot use functions that depend on interrupts inside this function. Delay is definitely such function and sendRaw probably too. Try to only set a flag in the recieveEvent and call sendIR from loop if flag is set.