There is certainly a place for sorrow and mourning. These are emotions with which God has created us. So, yes, it’s OK to feel sad sometimes.
The Philippians 4 passage is reminding us, though, that our sorrow and mourning aren’t all-consuming. They don’t have the last word, Jesus does.
There is hope and a reason for joy, always.
When people were mourning in the church of the Thessalonians, Paul reminded them that we do not mourn as those have no hope. We know Christ defeated death. Psalm 30:5 reminds us that while sorrow may last the night, joy comes in the morning.
Let’s read the full paragraph of Philippians 4:4 and see how God positions the encouragement to rejoice in the fact that He cares for us, listens to our prayers, and gives us His peace.