macOS 12.5.1, ActivityWatch v0.12.1
When an app is opened for the first time (i.e., quit, then reopened), it is not tracked. Instead, it continues as the previous window, at least as shown by the timeline.
Close any app. Then reopen it. See that until switching away and then switching back, the wrong app is tracked.