That's nowhere near long enough to recharge a stone dead battery. Yes, it is detrimental to completely discharge your battery. In fact, it's not good to go even below 75% of full charge for any length of time. However, unless your battery was on its last legs, it may be recharged and give you many years of good service. You need to trickle charge the battery to replace the energy lost. It will likely charge at 8-10 amps for at least 24 hours.
40 minutes is 0.66 hours. A typical alternator may put out 100 amps for example. Much of that can be consumed by the vehicle, especially if you run fans as an example while the battery is trying to recharge. So you're not getting the full charge capability of the alternator while driving. Let's say your getting 60 amps to the battery. 60 amps * 0.66 hour is only 40 amps!! Not nearly enough to work the starter motor which can draw hundreds of amps for short periods needed to crank the engine.