I've done semi-professional matching using a Munsell Book of Color, which is a spectral map of the entire color space, using about 1600 paint chips. Note that Munsell is owned by XRite, who also owns Pantone (which is NOT a color space map, and arranges their colors arbitrarily). XRite also makes the paint scanners used at the hardware stores.
It's not easy to do. I have tried to "bracket" the original color using Munsell candidate "chips", capture all in the same photograph with even lighting and all glare carefully eliminated, pull it into Photoshop and compare the RGB values.
It's a huge mess. Most photos are rejected because the original color is not a consistent RGB value left to right and top to bottom, because of a lighting or glare issue. Even when everything seems right, the RGB values don't result in good interpolation because of difference in surface reflectivity, or simply that "seeing colors of light as RGB" is itself a very flawed model.
The only system I've ever found that works is to order full 8.5x11 sheets of the candidate colors, "bracketing" high and low in hue, lightness and saturation, and putting the sheets against the work and eyeballing it.
This would be the equivalent of ordering many sample cans, but the simple fact is, sample cans aren't that accurate for reasons Mark discusses above:
The machine that puts color into paint has a minimum dispensable amount of colorant. A gallon of paint may require 27 "drops" of one color, 19 of another color, 3 drops of a third, and 2 drops of another. A small 8 ounce paint sample needs 1/16 of each measurement. Since it can't dispense less than a "drop", you probably get 2 drops of the first, 1 of the second, and none of the others.
The most effective thing I've ever done is ordered sample cans which "bracket" the target color, and "mixed my own sample" by starting with a few CC's from each can, and then adding a bit more of the color I'm trying to move it toward. It is slow trial and error. Once found, paint some drift cards (properly), compare the drift cards to the original, and if they check out, have gallons made of that.