I tried pairing both devices through bluetooth, but that didn't fix the issue.
Then I removed both connections (forget device, from both devices), and managed to fix the issue by signing out of my apple id on iPad, then logging in again. I didn't have to pair the devices again, sidecar over Wifi is working normally now.