Hey there, gargar1004!
Thanks for posting this and providing this error for us to assist. Based on what we've gathered, you'd like to record the iPhone screen using QuickTime Player on your Mac, but receive error "The operations could not be completed."
Use an iPhone, iPad, or iPod touch connected to your Mac is an excellent place to begin and confirm your settings to accomplish this.
Then restart both devices, Restart your iPhone and How to turn your Mac on or off
Make sure you're using an Apple branded cable to connect the unlocked iPhone to your Mac directly (without any USB accessories, like a USB hub). You can also test other cables to ensure it's not happening due to the current one you've used.
In case you still haven't resolved this, backup anything important and check for any software updates: Update your iPhone, iPad, or iPod touch and How to update the software on your Mac
If it continues to provide this error, tell us if you have issues connecting any other USB accessories to the Mac.
We hope this has helped and wish you a quick solution!