You should probably report that.
I also don’t see the sense in this example.
The difference between doFirst and doLast is just to which end of the task action list the action is added.
I guess the doLast should not be there but the contained line directly in the task configuration closure, then it would make sense.
This example was recently added with the 8.14 release.