Its difficult to get at the frame in that area, all the plastics need removing to get at the nut, but need to be refitted before you can bolt the rack on.
I had a similar problem with the pannier rack fitting, two bolt fit in holes next to the ones you are having problems with. One fitted easily but the next cross threaded a bit, when I tried to unscrew it for another go the tiny weld holding the nut in place snapped off. The bolt is still in place and I have no way to remove it or fully tighten it up.
One Idea for fixing your problem,
Knock out both nuts and remove them.
Cut a length of steel bar 3mm thick to slide into the frame, mark off the hole positions and remove.
Drill clearance holes through the bar.
Weld m? nuts under the clear holes.
Insert the bar into the frame and check the holes line up.
Refit all the plastics and you should now have access to two nice new threaded holes. No spanner is needed to tighten as the bar prevents rotation.
The bolt I have is just spinning because the rivnut split into two pieces.
The bolt is in the hole that's furthest from the camera in this photo. (It is surrounded by spacers).
As you mentioned, it is hard to get to the rivnut since it is in the rectangular subframe. I have to remove the plastic tail assembly, but the bolt gets in the way of the plastic.
Catch-22.
I get a dremel and took off the top of the bolt. Out came the spacers. After work tonight I'm going make another cut, hopefully close enough to allow me to peel back the plastic. I have to avoid cutting the plastic instead of the bolt!!
As you can see, the bolt is somewhat recessed under the plastic.
I have a dremel grinding bit that should help get closer as well.
Once I have everything out, I will reinstall. My hope is that I will be able to get a spanner+nut+washer underneath the bolt with all the plastics installed.
Maybe I can stick some tape on the nut+ spanner and reach in there. Haha....shows how desperate I am!!
As you can see in the photo, the plastic needs to go on before the bolt. I think I will have enough room to back the bolt up with a nut if everything is loose enough.
Your idea seems sound, though. The welded nut idea is better than the rivnut. Who am I to question German engineering?

I hope my plan works, I do not want to do any welding.
Hopefully you can get your bolt out, too.
Funny how a small thing turns out to be a HUGE project.....
