I found the solution to my problem after a lot of hours..
I found the answer through this post: https://magento.stackexchange.com/questions/6643/fatal-error-call-to-a-member-function-getdata-on-a-non-object
The post of @ProxiBlue is the solution. I find out that if you need to load the order, this is the correct way:
$orderIds = $observer->getEvent()->getOrderIds();
For the reasons the previous post explains!
So the answer of @Rajiv Ranjan might be partially right. Thanks a lot.