Of course two things would have avoided this mess for you:

1. if the withdrawal agreement had covered people like you.

2. if UK and EU had agreed on matching 6 month per visit per country visiting arrangements.