A woman who spent 550 days in hospital was arrested and evicted after the NHS trust took High Court action against her.