Could it be that you forget to press the Alt key or it is somehow not working? In the first picture the cube is selected, and the second picture is from inside the cube. You usually get this by pressing Ctrl+Numpad 0 > Set Active Object As Camera.
Or check in the 3D Viewport menu, look at View > Align View > Align Active Camera to View and also View > Cameras > Set Active Object As Camera which shortcuts are given there, maybe you changed something accidentally.
Another possibility: you accidentally set the cube as camera. If you then go into any different view and press Ctrl+Alt+Numpad 0, the cube gets aligned to the view but you are also seeing the inside of the cube again, because it is the active camera.
EDIT: Now that I see the XYZ orientation axis in your second screenshot, my last suggestion seems most likely.