Loading and re-loading etc. the Transparency may be a bit time consuming. (I don’t understand what the double inversion is supposed to achieve.)
I would recommend storing the luminance in a new file and using a Solid Color Layer set to Blend Mode Lighten (starting with 254/254/254) and check the Histogram.
As long as all the pixels have the same value no lighter pixel can be underneath, so when the Histogram starts showing more than one spike that would be the indicator and the appropriately adjusted Channel can be used as a Layer Mask.