This isn't an issue with your iPhone or Safari, it's an issue with Google not being able to automatically detect your system theme.
To resolve the issue, do the following:
- Go to google.com
- Scroll to the bottom of the page
- Click "Dark theme: on" to toggle the setting

If this doesn't work, (still on Google.com) click on Settings > Search Settings > Other Settings. There should be an switch to turn dark mode on/off
When searching on Google, you can click the hamburger icon (three horizontal lines) on the top-left of the screen to reveal a menu. From there, click on "Dark theme" to toggle the setting.