I don't know whether there are any grounds for her being held - but even if, based on the law there, there are - I don't think the majority of British people would expect, or appreciate, a Foreign Secretary making a statement which has made her situation even more precarious.
I don't think any of us can be sure as to exactly what Nazanin Zaghari was doing in Iran but, whatever it was, I would expect a member of our government to make useful, and hopefully persuasive, representations on behalf of a British citizen rather than cause even more problems.