Is it wrong that how to attach IAM Role to Lambda on the page "AWS Lambda Guide - IAM"?

Is it wrong that how to attach IAM Role to Lambda on the section Custom IAM Roles on the page AWS Lambda Guide - IAM?

I doubt following sentence is wrong.

The role attribute can have a value of the logical name of the role, the ARN of the role, or an object that will resolve in the ARN of the role.

When I defined on serverless.yml as follows, an error occurred.

...
functions:
  func:
    role: customRole
resources:
  Resources:
    customRole:
      Type: AWS::IAM::Role
      Properties:
        Path: /my/cust/path/
        RoleName: CustomRole
...

But when I defined on serverless.yml as follows, an error does NOT occurred.

...
functions:
  func:
    role: !GetAtt customRole.Arn
resources:
  Resources:
    customRole:
      Type: AWS::IAM::Role
      Properties:
        Path: /my/cust/path/
        RoleName: CustomRole
...

Therefore, I doubt that the role attribute can NOT have a value of the logical name of the role.