Simple keyframe question in Blender animation
Your mistake was to animate the cube while you should have only used the bone. There were two different animations: the cube and the bone. If you choose to parent your cube to a bone (with ctrl P > Set Parent to > Bone), then use the bone only to control the cube. By the way, in the Dopesheet bottom menu, click on the arrow button, it allows to display only the keyframes of the selected object, it will help.