Register host error

Problem:

curl -sS --insecure https://hostname/register
echo “ERROR: unauthorized”;
exit 1

Expected outcome:
sucessfully enrolled.

Foreman and Proxy versions:
3.4
Foreman and Proxy plugin versions:

Distribution and version:
foreman-3.4.0-1.el8.noarch

See Managing Hosts

curl --insecure --user admin:changeme https://10.0.0.128/templates/register-new-host | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1564 100 1564 0 0 35065 0 --:–:-- --:–:-- --:–:-- 35545
bash: line 1: syntax error near unexpected token newline' bash: line 1:

What is the output of that command?