Layout in this case is referring to the View Layout configuration for the specific entity you are using.
I would suggest first running a call using fields=* to return all of the values that are valid for use in "layout="
You can do this by running a call similar to this: rest-services/e999/meta/Candidate?fields=*
The "names" values that return from this call can then be swapped into layout=values. This will help to determine if the value you are setting for layout is valid or not and whether it is causing this error.
2. Then i sent a request using `/meta/Candidate?layout=id` using one of the values from the `name` returned in the previous request. This request returns a 500 status code
The layout is intended to return the View Layout configuration for the entity. So for example, layout=ListRow or layout=ProfileRightSideBar could be used to return that information for the Candidate entity.
Can you try a call similar to the following and let me know if that still returns an error for you?
GET rest-services/[redacted]/meta/Candidate?layout=ListRow&BhRestToken[redacted]