I also was surprised to learn this fact. I originally thought that the current state of input would be stored along with each savestate, and that loading a savestate would replace the current input with what was stored. But in actuality, the input state is a kind of global property of the emulator, one that remains the same as various savestates are loaded, and is only "cashed in" to become a part of the input log after a frame is advanced.
At Post #532299 I talk about adding joypad state to a "savestate object" data type defined in Lua code, in order to make inputs be saved and restored alongside savestates, as I originally and wrongly guessed they would be.
I encountered a minor bug where input in TAStudio isn't displayed correctly at the top-most row for one frame.
https://i.imgur.com/rE8JWzs.png
1. In recording mode, advance a few frames. (A)
2. Then load a state from an earlier frame. (B)
3a. Press any button on this frame. It will be correctly shown (C1) but on the next frame the row will be shown as empty (C2).
3b. Don't press anything on this frame. The row will be empty (D1) but if you press anything on the next frame, the input will be shown for the current row as well as the top-most row (D2).
I noticed another minor bug with TAStudio where input of the last frame isn't displayed on the emulator screen.
The three A presses before the last one are displayed by "View→Display Input" on the emulator screen, but the last one is not even though it is executed.