The image attached shows a simple red stone setup that multiple people on YouTube and forums have used, it works successfully in their videos. When a minecart with a chest has items in it, it is supposed to come to the hopper which would pull an item out of the minecart and send a signal to the comparator to unpower the redstone dust and turn off the powered rail so that the minecart stays in that spot until all of the items have moved through the hopper and into the chest below. When the hopper is empty the powered rail turns on again and sends the minecart back in the direction it came from.
What's actually happening is, the minecart will not ride onto the powered rail if it is powered. When it gets right up to the powered rail, but still on the basic rail right before it, the minecart reverses directions. Sometimes a single item may still pass into the hopper but it usually happens too fast for the minecart to be stopped there when the powered rail turns off... since the minecart refuses to go onto the rail above the hopper.
I have tried this set up facing different directions (north/south, east/west) and it will not work either way.
If the powered rail is off, the minecart has no problem riding onto it and stopping at the solid block to unload the items. There may be a way to send the minecart back when it's empty but it shouldn't be that complicated since there are so many videos online showing how it should work properly the simple way.
I have tried this setup in survival and creative but it just will not work for me.
Thank you for your time.