It’s not rare, though it may not be for a year. And you can’t sue because the government did nothing wrong. You were found innocent at trial, that’s how things work. People found innocent don’t get to sue the government for wasting their time. If you can’t bail out you’re stuck waiting in jail.
Again it happens but very rarely. There will always be prosecutoral misconduct unfortunately. And yes absolutely you can sue anyone for anything. If you believe you were detained for too long you can sue the government. People do that all the time - sue for governmental neglect. You just have to have strong enough case. If you were held day too long thats nothing. A year thats a plain abuse.