High Res Screenshot With Custom Depth Mask Not Working

Hello everyone, I am trying to take a high res screenshot in blueprints when the user presses the fire key. It works fine with the default high res screenshot settings. However, when I enable the custom depth mask as I want to mask out and only have the target, it saves a blank screenshot file. I have enabled the custom depth checkbox on the targets I wish to key out.

I have also tried various work arounds as outlined by the two articles:

I have also tried using a console command, which crashes unreal. The command can be found here:

Attached find the two images, one without the mask enable and the second with the mask enabled.
MaskError

Please offer any suggestions as to why this is not working.

I found out that the object was past the render distance that unreal would render the object.
A very hacky solution by editing the built unreal material asset function was found here, but hey, if it works:

This took me forever to figure out, and I feel there should be a better solution.
Anyway, thanks for the help guys :stuck_out_tongue: