Hello bughu,
Thank you for using the Apple Support Communities. I understand you're running into issues capturing an iOS screen recording using QuickTime.
Which Mac and iPhone models do you have, and also which macOS and iOS versions are you running? You can check your macOS version by clicking Apple menu () > About This Mac, and your iOS version by tapping Settings > General > About.
If you try a different cable and/or USB port to connect your iPhone, does that help?
How about if you restart both devices and try again? You can restart the Mac by clicking Apple menu () > Restart, and your iPhone by using these steps: Restart your iPhone, iPad, or iPod touch.
If the issue persists, try opening iTunes on your Mac. Does your iPhone show up as expected here? Are you able to allow access to your iPhone and sync it here? Knowing this would help narrow things down a bit.
I hope this helps get you started.
Take care.