Your code works fine. This is not really a surprise as this issue rarely happens, but rarely * 1,000,000+ = regularly :o(
I am fairly certain it must be a timing issue. Maybe when our clients server is under heavy load the iframe is not served quickly enough. Could it be that Cute Editor attempts to access the iFrame before it is fully initialised?