Instead of referring to the service principal by its display name, use it's application_id.
It isn't overtly stated in the documentation you shared, but you can see it in the example portion.
-- Granting a privilege to the service principal fab9e00e-ca35-11ec-9d64-0242ac120002
> GRANT SELECT ON TABLE t TO `fab9e00e-ca35-11ec-9d64-0242ac120002`;