Oh so you were legal... I am not sure than why they arrest you and sent you back home?I
dint go out of status I was legal till my last day and as the CBSA officer told me that I have to leave Canada and honestly left Canada the date which she gave me , I fact I left one day before my last day in Canada and with my husband s ticket
Anyway, I am not sure how can you prove they were wrong and you were right. What I would do, just apply Outland sponsorship application... and get back to be with your husband.
https://www.cbsa-asfc.gc.ca/security-securite/rem-ren-eng.html