I think that the example with ‘walking stick’ proves my point that context is necessary
All righty, but would your context required be figurative context, textual context, non-textual context, or co-text? All of these -texts are real examples of the present-day usage by renowned linguists who articulate them in public with a straight face.
Back to the bone of contention:
(1)…precluded him serving in the army…
(2)…precluded his serving in the army…
In both (1) and (2), preclude
needs its object.
In (1), "serving in the army" post-modifies "him," because, as we know, the modifier serving…
is a participle and cannot be a gerund.
Sanity check: …. His religious beliefs precluded him. It works. Check.
Thus, …precluded him standing in the back row behind the infidels of lower rank, …precluded him serving in the military, …precluded him being married to Sue…, ...precluded him scratching his back…
All of them are grammatical, unambiguous, and capable of standing on their own; the participles denote states or activities (=situations) that the subject He
was engaged in when precluding was applied. The verb scopes this far.
Meaning to say (2) and saying (1) instead is common and, well, illiterate.
The possessive that coerces a gerund reading of the –ing often fixes such problems (possessive pronouns being a prime example), but it is not a universal solution. Most inanimate common nouns refuse to accept the possessive in 's. No wonder the blunder is so common.
Homework for the enthusiast in you: What's wrong with (a) and (b)?
(a) I take no pleasure in oboe music being out of favor.
(b) The chances of that happening are slim.