A Bipolar transistor works because there is more going on than just connecting 2 PN junctions (diodes).
Have a look at this picture:
this picture is one of the few that actually shows the base region (I encircled it in red) in the correct proportions. The base region is very narrow and also shared between the Emitter-Base NP junction and the Base-Collector PN junction.
The fact that the base region is both shared and narrow is essential to the current amplification properties of the bipolar transistor.
When an NPN is in active mode, the BE junction is in forward. This causes electrons to flow from the emitter into the base. If the BE junction was a separate diode then all current would have to leave through the Base contact (because there is no collector).
But in an NPN there is a collector and it attracts the electrons because the transistor is in active mode so Vce will be large, the collector has a high positive voltage. The electrons are pulled to that high voltage.
As the base is narrow the electrons have a high chance of not making it to the base contact as the collector is pulling them in. So most electrons travel from emitter through base straight into the collector and that means these electrons do not reach the base contact at all. That could not happen if you would use two separate diodes.