Thank you. There are two gates, one large and one small. They jam together at the top making it difficult to open. There is a gap at the bottom. that's why I thought the gate was sagging. Adjusting the bottom hinge doesn't help.
The connection seems to be in the switch socket. as we disconnected the cable that operates the ceiling light so at the moment the switch just operates the wall lights but we want the ceiling light back again to operate independently of the wall lights.