When I was concerned with the screw length, I have installed the Optic on the adapter plate with the plate off the pistol and inspected where the screws bottom out.
Its possible a pistol might have openings to allow for screws to extend past the adapter place, so check for that, but in most cases the screw can't extend past the bottom of the plate.
Ideally, after torqueing the screws down you want a couple of threads remaining before the screw is flush with the bottom of the plate.
It is possible, the screw won't extend far enough into the threads and won't have enough purchase on the threads and thus will strip out when torqued down. So check the optic is seated and the end of the screw is into the plate far enough to be almost to the bottom of the plate, before torqueing down.
When I have had screws too long, I have filed them down, when I had screws too short, I have found longer replacement screws at the hardware store and then filed them to the correct length. Many ACE and True Value hardware stores have an extensive fastener Aisle that includes "Gun Screws" that likely will be perfect for your project. The bigger home improvement stores often do not. While there, get nuts that fit the thread also, they are needed if you have to shorten the screw a bit. Most of the Gun Screws will have a "fitting plate" you can buy for the correct threads, cause a lot of the gun screws are so small, they won't carry a corresponding nut. I have used that fitting plate to fit the screws...
Remember, when you cut or file a screw, you mess up the threads at the cut, you need to have a nut on the screw before cutting/filing, cut it as square as possible, then run the nut over the threads, back and forth a few times to clean up the threads so that they will thread into the female threads after cutting.
You can use the plate as the nut when cutting, but remember, if you slip up and scratch the finish on the adapter plate, its not only a cosmetic flaw, it opens it up to future corrosion. I have cerakoted the adapter plate, for some gun projects, so in this case, I fitted the screws perfectly using the adapter plate filing them flush with the plate, then removing the optic and turning them two turns past flush and file flush again, which removed all the finish on the plate, but I then cerakoted it, making no difference in the end.