Why would a creature that lives on the surface of a planet evolve limbs that can bend at many points (like a tentacle or elephant trunk) and still end in some sort of hand-like appendage?
The end of elephants' trunks have two 'fingers', and so already sort of fit your requirement.
Something similar is prehensile tails, like monkeys use to hang from branches.
Consider a very low gravity situation, where weight can be supported without a firm skeleton inside of the flexible limb, or the animal sort of 'floats' from place to place (basically replicate the buoyancy of being underwater).
A weirder possibility is that the limb could function like a penis, where it's deflated when not in use, but becomes rigid when it needs more structural strength. In order to have evolved that way at all, it would probably need to have some environmental reason for deflating (like preventing injury), or some secondary purpose that was still functional when deflated (like urination).
I think the primary question you haven't addressed in your question is whether ALL of the animals' limbs are like this (like an octopus/starfish), or if they have a specific flexible limb for some other purpose (like an elephant).
Tentacles are great at grabbing, pulling, and stretching to variable lengths. Their main weakness compared to legs is a lack of strong support. They probably couldn't compete with legs for walking, but they'd be perfect for climbing trees.
Imagine a swamp-dwelling octopus that learned to climb partially submerged trees like a mudskipper. From there, it could progress to a monkey-like, tree-swinging niche. If they evolved in an isolated environment and encountered our own monkeys later, they might out-compete them.
Tentacle are more flexible than arm so every situation where extra flexibility is required can lead to a land creature with tentacle-like appendages.
For example, if the creature live on a mountain where insects hide in small gaps between heavy rocks. The creature can't move the rocks but it can slither is tentacle on the gap and catch the insects .