Is there any way to unlock my phone from a mobile network carrier so I can use a different sim?
I can't believe it but I managed to resolve the problem.

Just a quick list of details to help future google searches:

I had a BQ Aquaris M5. Bought it sim-free, but then added a giffgaff sim.

Later I changed to a three sim, removed giffgaff sim and inserted three sim, but three network was not recognised. (Emergency call only.)

Resolved problems by going to System Settings -> Data Usage (or show more) -> Cellular Networks (might be hidden in top right corner) -> Set Preferred Network type to 2G/3G/4G AUTO, also go to Access Point Names, click Reset in right hand top corner menu, then go to Network Operators and check network operator is correct. Possibly restart your phone.

Happy to report mine is now working!