As others have said, it depends on how important it is for you to go.
Sounds like you don’t want to go, and are looking for an excuse - if that’s the case then you are entitled to say, sorry I would have loved to attend but I have a prior engagement etc.
Do you mean that you feel the invite was sent out of obligation than a desire for you to actually attend? If that’s the case and you wouldn’t feel comfortable going, then you shouldn’t go.
If however you do want to go, then I wouldn’t use the timing of the invite to stop you going.