It would be a major stretch to get jail on this matter, assuming that you are not under some specific order not to be where you were. It would not hurt to consult with an attorney or legal aid to see if your attorney cannot get the charges drop. No reason to have a record due to some technical interpretation of the law by the officer. It may be a crime, but there was no harm in what you did.
I think that jail is extremely unlikely in Brooklyn on this charge but you do want to consult with an attorney. However, if you have a criminal record that may not be the case. Feel free to contact me at (516) 280-9035 or write me at [email protected] and I can better answer you questions or concerns.