Sunscreen on babies under 6 months

I'm taking my daughter to the beach the first weekend in June so it's in 2 weeks she will be 5 months old may 29th. And I'm taking an umbrella and she's going to be in her stroller with the hood covering her but I wanted to take her out for a few minutes and take some pictures and let her feet touch the water and let her feel the sand in between your toes I asked her doctor if it would be okay to put sunscreen on her just as a precaution I'm not going to have her in the direct sun. And they freaked the hell out and told me that I can't take her to the beach and she's going to get dehydrated and sunstroke and everything else but babies live at the beach so I'm pretty sure I can take my daughter to the beach for 3 days I paid $900 for it for my 21st birthday I'm not drinking or anything I just want to go to the beach and take my daughter and relax and it's non-refundable so not taking her isn't an option because I breastfeed I wouldn't go to the beach without her anyway even if I wasn't breastfeeding. But I was just wondering if any of y'all have put sunscreen on your babies before 6 months old and if they were okay and I don't understand why you can't put sunscreen on them if theyre under 6 months, so if anyone knows why and could tell me or explain it to me that would be great! I just dont want her to burned i want to take every precaution possible. She doesnt really have any skin allergies to anything i under 4 months but shes one month til she can wear it. Do you think itll be okay for her to wear sunscreen at 5 months old?? I want to use the blue lizzard baby kind