Babies crying just before micturation or defecation n getting relieved after passing might b normal.
Next Steps
Since u have noticed this for the first time plz wait n watch if she has such frequent episodes, fever, poor feeding then get a urine routine n culture done.
Health Tips
also look for any local rash.