The confusion stems from the date of the Emancipation Proclamation which occurred in 1863. Then we have the date of the surrender of the Confederacy in 1865, and finally the passage of the 14th amendment which made it a constitutional issue and set equality as the law of the land. I cannot remember the exact year of the 14th amendment.
The Emancipation Proclamation only freed the slaves in the states fighting for the South; it didn’t free the slaves in the border states fighting for the North. It was very specific on that point.
When blacks mention “400 years of oppression”, it was much closer to 82 years in terms of the US (the end of the Revolution until the end of the Civil War); if they want to chase down the English, Dutch, and Spanish monarchies that brought slaves here, all the power to them...
The Emancipation Proclamation did not free anyone immediately but it meant that as the war progressed more and more slaves were freed as the Union armies gained control of those areas. Slavery was probably dead throughout the Confederate States once word came of General Lee's surrender. But there were still some slave owners in the loyal slave states who tried to make their slaves obey them. The ratification of the 13th amendment, in December 1865, officially ended slavery everywhere in the US.