Hi Mark,
No. Your version isn't quite right either. I'm afraid you're guilty of letting your participles dangle ...
In both versions of your example, it's the first and second clauses which are important. The first is a subordinate clause, but more importantly, it's non-finite - ie it doesn't have a subject. The verb is in the present participle form.
The rule of this type of sentence is that the (unstated) subject in the non-finite clause is always the same as the subject in the main clause. So eg
Linda went to Cannes, hoping to get a glimpse of George Clooney = Linda went to Cannes and Linda hoped to get a glimpse of George.
The non-finite clause can, as in your example, come first, so that the reader/listener has to "wait" to find out the subject
Trying to get a glimpse of him over the heads of the crowd, Linda tripped and twisted her ankle.
It's still Linda who both tried to get a glimpse and tripped - ie we find out the subject of the first clause when we get to the second.
The trouble with both versions of your example is that the subject of the first (non-finite) clause is
not the same as the subject of the main clause (the policeman).
So we're left with what's known as a "dangling" participle" - ie a participle clause where the subject is never (grammatically) stated, even though we can work it out, and more easily so in your version (which is why it seems better). But it's still ungrammatical in terms of SV agreement- sorry
You'd have to rephrase it something like :
Trying to take a closer look at her, we pushed to the front of the crowd. But a police officer told us to stay back.
Dangling participles can often be unintentionally funny. Here are some I found on the web :
Removing each other's fleas, the zoo workers watched the monkeys intently. Having finished my dinner, the waitress offered to bring out the dessert tray.
After being cracked open, the cook fried the egg.
They are, however, commonly used and are often comprehensible. Not using them is really just stylistic advice rather than true descriptive grammar. probably good stylistic advice though in order to make sure your meaning is a) fully clear and b) not unintentionally humorous aas in the above.