When the Spring Cloud Data Flow server uses local deployer to handle the task lifecycle management(launch, stop, etc.,), the corresponding task execution log can be obtained only when the task execution status is RUNNING.
This is by design because the local task launcher prunes the task instance history every time a new task instance is launched and hence the access to the log is not available, which is explored by the code here.
The reason was not to grow the number of Task process IDs in the local deployer' in process Map. You can see the issue related to it here.
But, this causes some side effects as discussed in another thread as not being able to show the previous instances' task execution log in local
deployer mode.
I think it would be ok to consider having some X number of task executions in history and that way at least we can avoid these side effects for a few executions in the history. Created a GH issue to track this.