It looks like you've encountered a limitation of Safari for iOS, where the Fullscreen API is largely unsupported, being usable only for iPad devices running iOS 12 or later (MDN, caniuse).
Safari users on iPhone and iPod devices will be unable to take advantage of true fullscreen functionality, though you can get quite close by prompting users to add your web application to their home screen and applying specific
<meta> tags to your page. You'll also want your game to span the entire content of the web page. From the great answer here:
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="viewport-fit=cover, user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
Outside of the above, one can reduce the visibility of Safari UI – completely hiding it when in landscape – through certain interactions such as scrolling. See this answer for more details on how to make clever use of this. (Previously this could be done programmatically, though Apple's patched that option for now.)
Note: in the past, this functionality could be enabled for iPhone/iPod devices through Safari's advanced settings pane (Settings > Safari > Advanced > Experimental Features > Fullscreen API), though this is unfortunately no longer the case.
Related, somewhat dated (iOS 6) question: https://stackoverflow.com/questions/12822739