The Canon R6 II has focus bracketing.
https://cam.start.canon/en/C012/manual/html/UG-04_Shooting-1_0340.html is the relevant info in the manual. As far as using a flash in this process, it should work. There aren't any notes in the manual about it not working with flash. Also I don't know if the frame rate when shooting auto focus bracketing is faster than your flash recycle time and if the camera will wait on the flash to be ready or not before taking the next shot. (more on this below)
I shoot handheld macro with my EOS R, which does not have a focus bracketing feature. I have my lens set to manual focus and simply move the camera back and forth while shooting. When shooting at 1:1, or close to 1:1, the depth of field of focus is very narrow and the chances of me taking two consecutive shots with the same part of the image in perfect focus is very slim. So my instability in holding the camera is a natural focus bracketing of sorts.
Now the flash...it needs to recycle quickly, or you need to shoot at a low frame rate. I normally shoot with my flash in manual mode and at either 1/8th power or 1/16th power. Flash recycle time (the time needed for the flash to be ready to fire again) is usually relatively short at these settings. Of course, recycle time is also dependent on the flash model, and what type of battery/batteries are powering the camera. If you have an AA powered flash, then NIMH batteries are the best, with the GP Recyko Pro Photoflash batteries are the best in all that I have tested with my Godox flash.
https://international.gpbatteries.com/products/recyko-pro-battery-2000-aa-photoflash-4 Maybe your flash has a built-in lithium battery and is very fast to recycle.
I take a few test shots in the beginning to get my flash exposure figured out, concerning iso etc. I usually shoot in the area of f11-f14 and iso 100 if possible, and a shutter speed of 1/200 which is the fastest the R can do without having to do high speed synce. But, I will bump up the iso if needed...hence the test shots.
I don't know who you watch on YouTube, but Micael Widel is my favorite in macro photography. He has several good videos on handheld macro photography, one of which is here: The link will start the video at what I think is the most relevant time for the topic of this post, but the entire video has good information.
https://youtu.be/sCpYs0vqmE4?si=OP7wLqBbGpNB3APF&t=442