The images of New Zealand prime minister, Jacinda Ardern, with her baby daughter, Neve, at the United Nations this week sent out a powerful message about women in leadership roles – and about parents in the workplace.

Just 5% of world leaders are women, and women are still significantly underrepresented in senior roles in business, media and politics. Women working in politics are less likely to have children than their male counterparts, and we know the gender pay gap becomes a gulf after the point at which women have children.

So a prime minister combining leading her country with new motherhood is an incredibly inspiring symbol for many women who are run ragged trying to make it all work – or perhaps contemplating starting a family with real trepidation about the impact on their career.

Yet along with the warm headlines came the inevitable snarky comments from the political world, and the constant judgment by others that is a hallmark of motherhood. Ardern was criticised for the cost of plane tickets after she made a special one-day trip to the Pacific Islands Forum in order to accommodate breastfeeding her baby, then 11 weeks old. Her daughter had to stay at home because she was too young for the necessary vaccinations, so her options were to either not go at all, or go for only a short time. Ardern summed it up perfectly: “If I didn’t go, I imagine there would have been equal criticism. Damned if I did, damned if I didn’t.”

I experienced a similar reaction to taking my 11-week-old son, Gabriel into the House of Commons chamber for the closing speeches of a debate earlier this month. While lots of people have seen it as a welcome step forward, plenty of others deemed it a disgrace. In July, in the wake of the Brexit vote where the Tory party chairman broke our pairing arrangement, I was criticised for nursing Gabriel at home instead of being at work.

Facebook Twitter Pinterest ‘I took my 11-week-old son, Gabriel into the House of Commons. While lots of people have seen it as a welcome step forward, plenty of others deemed it a disgrace.’ Jo Swinson with her son. Photograph: parliamentlive.tv

Take the baby with you to work, or stay at home: either way you’ve got it wrong. Some railed that I should have left my son at the House of Commons nursery, which is brilliant. However, like most nurseries, it doesn’t take babies until they are three months old.

The irony was that I attended that debate on proxy voting to speak about the challenges of combining new parenthood with being an MP. In particular, I spoke frankly about how hard it can be to establish breastfeeding, and how newborn care requires endless contingency – all of which makes the case for MPs who are new parents to be able to vote by proxy.

Breastfeeding is one of the elements the “just-get-some-childcare” brigade fail to consider when doling out their judgments. For example, to fulfil my responsibilities at the recent Lib Dem party conference, my husband had to take Gabriel and his four-year-old brother on to the seafront at Brighton, and pop back into the conference centre every few hours to pick up expressed milk and let me feed the baby. I imagine a similar operation was in place for Ardern at the UN, albeit in rather more illustrious surroundings.

Returning to work while breastfeeding is possible, yet often it feels too difficult to speak to the boss about the simple changes a woman needs to do this.

Jacinda Ardern queried for taking costly flight to minimise time away from baby Read more

Ardern is the first to admit she has many advantages that most new parents do not have, as do I. Being in a position of power, able largely to set your own diary with flexibility to accommodate the feeding schedule of a newborn baby, makes it possible to return to work and just about keep the balls in the air. Yet instead of support at work, many new mums get a P45. It’s a national scandal that as many as 54,000 women a year are forced out of their jobs just for having a baby.

And yes, of course there are many jobs and occasions where it is not possible, appropriate, or safe to bring a baby to work. I generally find it much more stressful trying to get work done while looking after children, and try to keep the two separate as much as I can.

But all parents know the messy, unpredictable nature of caring for children. Sometimes life and work collide. And if we don’t want to write people off in the workplace when they become a parent, we need steps towards more flexibility and less judgment. Baby steps at least.

• Jo Swinson is MP for East Dunbartonshire and deputy leader of the Liberal Democrats