Execute 'systemctl status <service>' is not working correctly

Hello.
I have the following build.gradle file

buildscript {
repositories {
jcenter()
}
dependencies {
classpath ‘org.hidetake:gradle-ssh-plugin:2.10.1’
}
}

remotes {
removeServer{
host = ‘127.0.0.1’
user = ‘sergei’
password = ‘my_sergei_password’
passphrase = ‘my_passphrase’
identity = file(’…/…/.ssh/id_rsa’)
}
}

tasks.register(“copy2server”) {
doLast {
ssh.run {
session(remotes.removeServer) {
execute ‘systemctl status client’
}
}
}
}
when I run this I receive the following message

Selected primary task ‘copy2server’ from project :
Tasks to be executed: [task ‘:copy2server’]
Tasks that were excluded:
:copy2server (Thread[Execution worker for ‘:’,5,main]) started.
mln3d#29|e=
mln3d#29|? client.service - Client
mln3d#29| Loaded: loaded (/etc/systemd/system/client.service; enabled; vendor preset: e
mln3d#29| Active: active (running) since Thu 2021-05-13 22:41:48 MSK; 5 days ago
mln3d#29| Main PID: 31578 (node)
mln3d#29| Tasks: 24 (limit: 2356)
mln3d#29| Memory: 82.5M
mln3d#29| CGroup: /system.slice/client.service
mln3d#29| ??31578 npm
mln3d#29| ??31589 sh -c next start
mln3d#29| ??31590 /bin/sh /home/sergei/client/node_modules/.bin/next start
mln3d#29| ??31596 node /home/sergei/client/node_modules/.bin/…/next/dist/bin/n

Task :copy2server
Caching disabled for task ‘:copy2server’ because:
Build cache is disabled
Task ‘:copy2server’ is not up-to-date because:
Task has not declared any outputs despite executing actions.
Connected to mln3d[185.217.199.28:22] (SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2)
Started command mln3d#29: systemctl status client

That means the command works, correct? Because I see the result. But I do not understand why I see the line
Started command mln3d#29: systemctl status client
and it is hanging infinite until I press stop in my IDE.
At the same time if I run the command ‘systemctl status client’ on remote server I see the same result but the bash is freed.
sergei@127.0.0.1:~$ systemctl status client
● client.service - Client
Loaded: loaded (/etc/systemd/system/client.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2021-05-13 22:41:48 MSK; 5 days ago
Main PID: 31578 (node)
Tasks: 24 (limit: 2356)
Memory: 82.5M
CGroup: /system.slice/client.service
├─31578 npm
├─31589 sh -c next start
├─31590 /bin/sh /home/sergei/client/node_modules/.bin/next start
└─31596 node /home/sergei/client/node_modules/.bin/…/next/dist/bin/next start
sergei@127.0.0.1:~$ _

The same result with executeSudo and pty = true;
What I am doing incorrectly? I would like to see result and task should complete after that.