Post Malone and ‘Impractical Joker’ were nearly jailed while filming in a New York City parking garage