I used to be the calibration coordinator for one of our manufacturing sites so have had a lot of experience in this area. Our company is using NIR analysis to release product (Cheese, Powders, MIlks) for the major chemical components, fat, moisture and protein and Lactose, SNF on milks. However in order to do this, as others have noted, this needs a very robust calibration program., which includes the right samples, testing, calibration and validation.
For our milk products we use a FT120 and this is calibrated using reference standards provided by an external company. Our cheese and powder calibrations are built on years of analytical data of our product against reference test methods. The equipment calibrations are checked regularly against samples of product tested using reference analytical methods. MIlk is probably one of the "easier" calibrations that can be made.
Most if not all milk companies use NIR to test their milks for both production and sale and there have been no issues in doing so. However the calibration requires regular "maintenance" seasonal variation in milk composition influences the test and calibration results. Calibrations are completed monthly and the data is added to the overall calibration to build a very robust calibration.
If you have the right data and can validate the calibrations on a regular basis to ensure it aligns with the reference test methods, there is no reason why you cannot use NIR analysis to test for chemical parameters and use that data to support the release of your product. It will just depend on what components you need to release on. The data you use is better if it is coming from you own products and own spectral data, You may get a base calibration from the supplier of the NIR equipment but it will need to be adjusted to fit your product matrix. It can be done, but to get a reliable calibration it can take many years of data collection and calibration.