If a person dies whilst in a rolling contract, and payments are still taken from the account for a few months,would the company be legally forced to return the money to the account?
Short version: No. The deceased tenant's estate remains liable for the rent until the tenancy is ended, typically by the person representing the estate giving notice to the landlord to end the tenancy.
This article by Tessa J Shepperson on the Landlord Law Blog covers this in some detail.
Quoting the relevant parts:
First off – a tenancy does not end when the tenant dies. What happens depends on the circumstances.
Regarding periodic (rolling) tenancies:
If there is no-one eligible to succeed to the tenancy under the ‘succession’ provisions of the Rent Act 1977 or the Housing Act 1988, then the tenancy will, as with a fixed term tenancy, pass to the tenant’s Personal Representatives as part of his estate.
If the tenancy is a periodic one, then the Personal Representatives will be able to serve a notice to quit on the landlord and end the tenancy that way.
What usually happens if that the landlord will want to take the property back and re-let it. However he does not have the right to just do this, unless this is with agreement with the tenant’s Personal Representatives.