I can tell you what worked for me, what i did was this worked on your iPhone, there are some steps you can take to troubleshoot and potentially fix the issue. Here's a guide to help you:-
1. Ensure Guided Access is Enabled:-
-Go to Settings on your iPhone.
-Scroll down and tap on "Accessibility."
-Under the "General" section, find and tap on "Guided Access."
-Make sure the switch at the top is turned on.
2. Set Passcode for Guided Access:-
-In the Guided Access settings, make sure you have set a passcode. If you haven't set one, Guided Access may not work.
3. Reset Guided Access Settings:-
-If you have previously configured Guided Access settings, try resetting them:
-Go to Settings > Accessibility > Guided Access.
-Tap on "Passcode Settings."
-Choose "Set Guided Access Passcode."
-Enter your Apple ID password when prompted.
-Set a new passcode or re-enter the existing one.
4. Check Accessibility Settings:-
-Make sure there are no conflicting settings in the Accessibility section that might interfere with Guided Access. Check other settings like Display & Text Size, Motion, Touch, etc.
5. Toggle Guided Access Off and On:-
-Turn Guided Access off and then on again:
-Go to Settings > Accessibility > Guided Access, & Toggle the switch off and on.
6. Reboot Your iPhone/iPads:-
-Sometimes, a simple reboot can resolve issues. Restart your iPhone and check if Guided Access works afterward.
Follow for more details instruction below.
https://www.youtube.com/watch?v=VqJigpKMIJM&ab_channel=TheGeekPage