I had a similar issue where I wanted an Anschutz/UIT rail so I could use a handstop for high power position shooting, and I wanted to add the rail to a M-lok handguard on an AR. I have a bunch of Anschutz accessories so having the same rail on an AR was appealing.
My solution was to 3D print an interface to accept a Freeland Shooting Supply UIT rail. The M-lok screws went through the rail, through my 3D print, and through the handguard. The primary purpose of the 3D printed piece is to have something that can be held comfortably in the hand. Also, with this solution, there is no permanent modification to the handguard.
One solution could have been machining the rail into the handguard, and not buying or building any extra pieces, but where's the fun in that?
I do not have any pics readily available of what this looks like in real life, but it has held up over years of use. The interface is 3d printed and coped to the diameter of the handguard. I have included a rendering of the object for reference in case you are looking to do something similar.
UIT Rail:
https://freelandssports.com/product/anschutz-blank-rail-section-15/