Context matters. Generally, it means to find out later that you were wrong, or using hindsight to identify a mistake that wasn't clear when you made a decision.
A child you are babysitting could be asking permission to go to the store, and you say yes and take them. Later, you find out the child was grounded by their parents, but they forgot to tell you.
You giving permission was not immediately wrong, but you may have caused an issue inadvertently.
Another case would be if you come upon an elderly person trying to cross the road. Later, you're asked if you've seen somoene's Alzheimer's stricken grandparent who keeps wandering off, and that person matches the description of the person you helped.
You assisting the person was not immediately wrong, but you found out in hindsight that you should have acted differently.