Shadow Catcher makes behind objects visible!

Hello guys.
I am facing an odd problem. I’m working on my VFX project hut when I render the final output (video) I noticed that behind objects are showing in render! (explained in pictures)
also there is another thing that in viewport on render mode everything is ok and behind objects are not showing.
is there anyway to fix this problem?
I also need to mention that I have change all objects mode to shadow catcher.
also when I check the Holdout box for all objects everything is ok but there is 1 problem that shadows are gone!

viewport screenshots:

Render output (as you see coffee beans that are behind the building they are also showing!) and
also this is a render image when I check the Holdout box for all objects , as you can see there is no shadow!:

Why did you change all objects to shadow catcher? I don’t understand that. The shadow catcher is a particular object made only to catch the shadows casted by other objects in a scene. All the other objects catch shadows by their nature.

Or are you saying “all objects” counting only the building and the sidewalk and not the coffee grains? That would be the right setup.