When you created the SECURITY in Q, did you set it to use Average Cost? Such a determination can't be set at the time of the sale.
I have not followed recent developments from the IRS on average cost approaches, but I do know that they used to recognize two systems -- 1) separate average cost values for long term positions and short term positions, and 2) one common average cost for both long and short term holdings. Quicken only processed on that second basis. So if a brokerage was operating under the first scheme and Quicken under the second, some type of discrepancy would develop. I would think your best bet would be to rely on the brokerage data for tax filing purposes and let Quicken be (hopefully) close . The only step I can see you taking in Quicken would be to do a Remove Shares followed by an Add Shares where the Add brings in the holdings at their correct (per brokerage) average cost.