Sounds like a reinstall may be in order. Search the Apple site for "macOS recovery options." There will be a keystroke combination you need to get the absolute latest macOS that your machine will support. I believe that combination is Shift + Command + Option + R at startup. This should get you to an Internet based recovery mode, and from there, you can run Disk Utility and reformat the Mac partition of your hard drive without touching the Boot Camp partition. That is, assuming you have nothing critical that you want to keep on the Mac side of things. If the recovery mode does not get you to Ventura, which is the last best OS that I believe your machine can run, it'll at least get you to the version that shipped with your computer. If your Mac came with anything earlier than Big Sur, then you need to at least get to that level before you take on Ventura. It's fairly easy to search for the version of macOS that you need to start with.
Reinstalling macOS should also take care of any firmware upgrades your machine might be missing, and you need these to re-attempt an installation of Boot Camp should that be necessary. This will also give you access to the latest driver packages with Boot Camp Assistant.
Your next steps will depend on whether your windows installation is intact or not. from your working copy of macOS, open the Boot Camp Assistant and select "download Windows support software" from one of the menus up top. At this point, you might want to have a flash drive handy to save this large package of files on. Boot Camp will ask you for a location to save the software, so use your flash drive instead of your local hard disk. A folder with all the Boot Camp software will be created on the flash drive or wherever you saved it. Once it's done, set the device aside, but keep it handy.
if Windows is still intact after reinstalling macOS, then restart in windows. Next, plug in your flash drive and rerun the Boot Camp setup file, which should reinstall all the control panels and any missing drivers that may be out there.
Since you have a 2017 machine, you may want to hold off on upgrading to Windows 11. There's a workaround, of course, but the further away you are from a recommended configuration, the less likely Windows 11 is to work without incident. If you do want to install Windows 11 again, you first need to create a modified installer using a tool called Rufus, which you can find online.
When I've had to roll back, it's usually the Microsoft Store that gets corrupted. That's probably the biggest thing you need to reinstall, and there's a fairly long Powershell command to essentially redo the Microsoft Store app.
my apologies if I'm running a little too long here, so let me wish you best of luck in reinstalling macOS. If you need further help, that's what we're here for.
Nate.