Although the other answers are good as well and a way to do it, your idea to use the Bevel Tool was good, too. But as Gorgious and Marty Fouts already explained, your bevel didn't work evenly because you had scaled the object in Object Mode, so you have to apply the scale with Ctrl+A before beveling.
The Bevel Tool has the advantage over the other methods described here, that you don't have to decide beforehand how high the resolution of the curve should be and if you have to build different sized objects like in your example picture, when you know for each one which dimensions it should have, you can start with simple cubes scaled to these dimensions and then create the curve.
First of all, to avoid uneven beveling it is best to scale the mesh to the desired size in Edit Mode because this changes the mesh, but not the object's scale. However, if you want specific dimensions it is easy to enter those values, but then you have to apply the scale as mentioned above.
EDIT: In my example the cube still has its front and back faces, but that doesn't matter for the workflow.
- Before beveling, Apply Scale with Ctrl+A in Object Mode so that it's 1 for X, Y and Z.
- Go to Edit Mode and start beveling with Ctrl+B. If you hit C, Clamp Overlap will be enabled. This way, no matter how far you move the mouse to increase the bevel, it will always stop when the bevel edges meet - if they don't stop, maybe clamping was already enabled. Simply hit C again to toggle clamping on/off.
- Move the mouse wheel to change the number of segments of the bevel. This way you can decide while beveling how smooth you want the curve to be. At the bottom you can see the number of segments displayed, in case you want to use the same for other objects as well (but usually, once you finished the bevel, this value is used for the next bevel anyway).
- When you've finished beveling, the "middle" edges where two bevels met now have doubled vertices. To get rid of them, since the edges should still be selected after bevel (or you hit A to Select All), hit M > Merge > By Distance.
- Another great advantage of this method is, you can first create one cube, select the edges to be beveled in Edit Mode, go back to Object Mode and now duplicate this cube and scale it to the respective dimensions for all the different objects you want to create. Then still in Object Mode select them all and apply all their scales with Ctrl+A. Now with all objects selected you can go to Edit Mode. They should still have the edges selected from the first cube. Now you can bevel them all at once and so all will get the exact same bevel.