No, this is wrong. There is no law that explicitly prohibits filming the public realm (e.g. the pavement) or incidentally capturing your neighbour's property.
There is a code of practice: the Surveillance Camera Code of Practice (SCCoP). There are also requirements to follow under the General Data Protection Regulation (GDPR) and the Data Protection Act 2018 (DPA).
The consequences of not following the SCCoP, the GDPR, and the DPA may result in regulatory action being taken against you by the Information Commissioner's Office as well as private legal action by the affected individuals, but it is not per se against the law to film those areas.