We are facing a similar issue and I believe the discrepancies come from two main causes: 1) Your Shopify instance is running in a local timezone (check store settings) and API data is always reported in UTC. This requires a simple conversion to your local timezone to match your store as part of your query or transformation.
2) Return dates differ from order dates. If you sell $100 today, your net sales is $100, but if $50 gets returned tomorrow your net sales is -$50 (all else equal). When you try to aggregate gross sales and discounts you need to do so by order date, but when you try to aggregate returns it needs to be done based on the return (refund) date, which is almost always different than the order date. My approach is to calculate a "report date" field that will choose the right date based on some criteria that I haven't yet fully determined, and use that to aggregate sales info. There may be a better solution.