An automatic crop for film scans sounds simple until you look at real scans. The border is not one thing: B&W negatives have bright rebate, slides have nearly black frames, converted color negatives often show a white mask on one side and black film edge on the others. Borders can be thin, missing on one side, or wedge-shaped when the strip sat slightly rotated.
AutoCrop is a Lightroom Classic plugin built for exactly this. It measures every border side independently, carries a confidence score per photo, prefers leaving a hair of border over losing image content, and writes plain Lightroom crops in batch. There is a free trial with 24 crops, so you can check it against your own scanner and film stocks before buying. See the documentation for the full workflow, including the recommended order with Negative Lab Pro (convert first, then crop).
More guides: How to batch-crop film scans in Lightroom Classic ยท Documentation