Hey guys, I managed to solve this issue (at least for my current situation).
For some reason my order had id_cart = 1 in ps_orders, so I looked at my shopping carts page and took a cart ID number from there and add it to id_cart. After this I could easily refund the order without errors.
Hope it helps.