I understand that you have to become a tax resident after 183 days and that the Spanish government can tax you on any gains made in the UK depending on when you sold your UK house and moved to Spain
Not quite. If you intend to stay over 3 months you should register on the EU foreigners residing in Spain register. If you spend more than 183 days in Spain then you become a tax resident in Spain. Your tax return completed the following year will only be for the time your were resident in Spain during that year. For example, become resident in March and your tax return the following year will only reflect that, not the total year.
You could, for example, still have a job in UK until March and will pay PAYE in UK up until then. You don't have to declare that for Spanish tax in the following year, just your income from March to December. Same with property, if you sell it before moving to Spain then no tax will be liable in Spain.
This 6 month thing is designed for those who are temporary visitors to Spain (or any other EU country). You can keep a car for up to 6 months as long as it is not your intention to remain longer than that in which case you have 30 days from arrival to start the re-registration process as it your intent to remain. .The 3 month and 6 month rules do not apply if you intend to move to Spain on a permanent basis.
Many people quote the time limits but they are wrong.
We actually did move to Spain in March after selling our property in February. None of our income prior to March was taken into account by our gestor and, in fact, it took us about a month to actually get the resident certificate and all income was only calculated from the date of the certificate (middle of April).
On another point, we had to take our UK reg car back to UK before we got the resident certificate (we didn't intend to keep it here) as we were informed that, as Spanish residents, we couldn't drive a UK plated car.