This is a bit long winded so I apologize in advance.
This happens from time to time for me as well. Mostly missing the gravity is because of several possibilities.
1) Setting your brewhouse efficiency to high. I use 80% for my calculations in BeerSmith for my darker beers and 85% for my lighter beers. My light ales are usually right on or within 1-2% of the target OG. My darker ones usually are in the 77-80% range or so. I shoot for no more than 3-4% error and if I am less than that I do my happy dance.
2) As mentioned by others, if you volume is off, your OG will be off. I always look at the sight glass on my boil kettle before I start chilling (about 5 minutes after EOB to let the wort settle down a bit) and adjust the OG calculations for what I see. Remember to correct the volume for cooling shrinkage (4%) to get the correct volume for OG measurement. If you are making 10 gallons, you should see about 10.4 gallons of hot wort in the kettle. Also, if you pitch your yeast before taking an OG measurement, you need to include the volume of the starter as a part of your overall volume. I always take my measurements pre-pitch.
3) Old grain or grain that yields poor extraction. Grain that starts to go slack will not give you the sugars you are looking for. We used to run into extraction efficiency problems from time to time when I did my professional brewing gig. Although the malting process is well controlled, we sometimes did not get the yield we were looking for from certain lot numbers and had to adjust.
4) Not extracting all of the sugars mentioned by others. Doing a mashout at 168 degrees will make the sugars more soluble and easier to run off.
I was following a recipe and the target OG was 1.065 but when we finished our OG was 1.044. Could this be from an incomplete extraction of the sugars in the mash itself? Could water chemistry play a roll in this? Should I increase mash time/temperature? Is there any advice on proper mash methods? We also did a BIAB FOR A 5 gallon used 10 lbs pale malt, 1 lb flaked oat, one lb flaked wheat, and 12 oz Carapils, with addition 12 oz turbinado sugar at 60 mins. Thanks any help is much appreciated.