So a penalty to long rest being outside of time wouldn't make sense to me because you are in game wise leaving the area to return to your camp, but maybe penalty for time sparingly but penalty for leaving certain events that disable fast travel such as a dungeons you enter to find a person or an item.
But overall I agree with some preventative measures one because food is a huge game changer as it heals with no limit. To the point of removing the need of a short rest for most clearing of map areas. Now to be perfectly clear I wouldn't want anyone to be directly punished for doing so either as it is part of the game and the game allows it and if they find it more fun to unleash all their spells in every battle all power to them. More of an iron man run. For instance Auntie Ethel's basement. If you were rewarded more handsomely for doing it in one run including a short rest instead of additional story missed. There is already an instance of a story option quest change difference based on long rests with Rescue the Grand Duke. I encountered the inn Waukeen's rest (I believe that was the name I do not have the game up at the moment) and decided to take a long rest to restore some spells and when I returned the inn was burned out and there was different npc interactions and paths leading to some where that you would not get for storming into the fire and saving the inn. Honestly next play through I am going to try to get to the inn without a long rest to see if I can prevent the goblin raid. But, to devil's advocate I would like to point out choses matters would mean events like Waukeen's rest is exactly what certain players want and makes replay throughs more interesting. So
But TLDR I agree there should be some prevention maybe on a harder difficulty so the majority of players can enjoy the majority of Larian's work and effort.