Nut groove and screw groove for screws with hexagonal shells are a common design element.
One thing to keep in mind is that if you put a nut in the groove then a screw length must then be used so that the screw does not bottom in the groove. If the screw bottoms when tightening, the nut will be pushed through the aluminum flanges before tightening.
In addition, one must be aware that this type of screw pockets can only achieve a small part of the strength found in the screw dimension for which the pocket is designed.
If you want to achieve higher strength, the contact surface must be increased against the outer flange of the screw pocket. This can be achieved with a “tray” of e.g. a plate bar or the like.
Below are some recommendations for nut and screw groove for hexagonal screws: