This page explains the steps to lock your iPhone during a call without ending the call. These steps are necessary because iPhones automatically end phone calls by default when the smartphone is manually locked.
How to Lock iPhone Screen Without Ending a Call
Here's how to lock your iPhone during a call without ending the call.
Scroll down and select Accessibility.
Scroll down and turn on the switch next to Lock to end call.