From the FM blog - A Quick Tip for Cropping a Single Layer: https://flyingmeat.com/blog/archives/2023/5/quick_tip_for_cropping_a_single_layer.html

TLDR: Commit the crop action with the option key down.

You can of course get the same effect using the select tool, using the Select ▸ Inverse menu item, and then pressing the delete key. But our minds all work a little different so it's nice to have multiple ways of doing something.