Adverbs of place and direction usually go in end position. However, they can be put in front position to emphasize location (and in this case, inversion is frequently used):
“Next to the bookshelf was a fireplace” (not “Next to the bookshelf a fireplace was”)
Of course, inversion is not used when a pronoun is a subject. Nevertheless, there are other exceptions:
“Through the waves the boy swam powerfully”
“Outside the church the choir sang”
“In the garden John built a play house for the children” (not "in the garden built John...")
Hewings’s grammar provides the following explanation (which I find hard to comprehend): “…we don’t usually put the subject after the verb when we talk about actions: if one of these intransitive verbs is followed by and adverb of manner; with other intransitive verbs; of with transitive verbs…” (Unit 76).
Is there a simpler explanation than that (such that a person with no linguistic background could understand)?