Yeah that sounds right, that loose wire coming out of the hole is likely meant to go onto that spade terminal with the brown wire (usually a ground).
Getting it out can be a bit fiddly, you might need a small pick or needle-nose pliers to gently pull it through without damaging it. Just be careful not to tug too hard in case it’s clipped or routed behind something.
Might be worth double-checking a wiring diagram too just to be 100% sure before reconnecting

<!--td {border: 1px solid #cccccc;}br {mso-data-placement:same-cell;}-->
https://bristolpainters.org.uk/