There is likely a loose wire of some sort somewhere on the circuit. Oftentimes, wires can become loose when a poor connection is made. You’ll need to have an electrician fix the issue.