The confirmation's ID isnt the same as the trade id. Make it check confirmations if the status is pending and use the newConfirmation listener which emits a confirmation object. Then use CConfimation.id as offer id and accept it using that.
I know theres a listener for new confirmations and all, I've tried making it myself but couldn't get it to work. Not at my main system right now so cant provide the code I had written. Help is appreciated