Absolutely. Humans are not machines, and attempting to maintain constant productivity is a recipe for burnout. Allowing time for rest and idleness does more than recharge the brain and body; it also allows for creative, unstructured thought that can foster breakthroughs. It may even increase productivity in the long run.
Many people also find that allowing themselves to be unproductive during periods of personal or societal turmoil is a powerful form of self-care. During the COVID-19 pandemic, for instance, many people found themselves coping with sudden anxiety, stress, and grief. Giving themselves the space to be unproductive, at least for a little while, allowed them to reduce their cognitive load and manage complex and painful emotions.
For more on the benefits of regular breaks, see Increasing Productivity.