My question involves landlord-tenant law in the State of: Florida, City of Tampa

My daughter rented a house with another co worker from Caldwell Banker in Hillsborough County Tampa. They both signed lease and split everything 50/50. The lease ends the end of May. My daughter wants to move out and the co worker wants to stay in a month to month arrangement. The agent from Caldwell Banker states that my daughter cannot get her deposit back until the co worker moves out, and that she would have to get the security deposit from the co worker.
I find this hard to believe and find it highly questionable, unethical and illegal.
If the terms of the lease have been met, how can they hold my daughters security deposit when she is not renewing the lease and force her to wait until the co worker moves out?

Is this legal and do we have any recourse to fight or sue Caldwell Banker on? Appreciate any help or advise with this.