I saw people in the time of the Messenger of Allah ﷺ being punished when they bought food in bulk and then sold it before transporting it to their lodgings.
أخبرنا نصر بن علي قال حدثنا يزيد عن معمر عن الزهري
رأيت الناس يضربون على عهد رسول الله ﷺ إذا اشتروا الطعام جزافا أن يبيعوه حتى يؤووه إلى رحالهم
Bukhari narrated it in Hudud, chapter on how much discretionary punishment and discipline may be given, hadith no. 6852, and Muslim narrated it in Buyu, chapter on the invalidity of selling a purchased item before taking possession of it, hadith no. 37/1527, from the hadith of Muamar bin Rashid, transmitted through him. It is also found in al-Kubra, hadith no. 6201.