So long as the preposition comes before a noun, the sentence is grammatically correct. Because of that, all the sentences pass the grammar test. However, passing the grammar test does not make a sentence useful.
#1 - good because walking is an activity so it makes sense to try 15 minutes of it.
#2 & #3 - poor because "walk" is not an activity. Either you take a walk or you don't. You can't subdivide a walk into units of time. The sentences are grammatical though. If you replace "walk" with another noun, "play", then the sentences suddenly become excellent. This shows that it is the word choice, not the grammar, that is bad. "Play" works because it is the name of an activity.
#3 - is poor for the same reason #2 is poor. You can fix it like this:
"Try just a 15 minute walk"
which does not subdivide the walk.
#4 makes sense because you are not subdividing anything. The sentence just says to allot yourself 15 minutes for a walk.
#5 makes good sense if you change the word order:
"Try a walk of just 15 minutes"
When you say it this way you are not subdividing anything. You are just describing the walk as a 15 minute walk.