Actually, it seems no such law exists in Germany.
https://blogs.loc.gov/law/2022/06/happy-sustainable-gastronomy-day-why-dumpster-diving-is-a-criminal-offense-in-germany/#:~:text=The%20activity%20of%20searching%20in,of%20the%20German%20Criminal%20Code. Maybe the police just felt like teaching those kids a lesson. Or maybe they kept the "fine" for themselves. Regardless of any of that, Priyanka's story does have value.
Here's a survey of various countries laws on food waste: https://www.finedininglovers.com/article/food-answers-which-countries-have-laws-against-food-waste