```ts
export function traceRelay(links: Record<string, string>, start: string): string[] {
  if (typeof links !== 'object' || links === null || Array.isArray(links)) {
    throw new Error('Invalid links');
  }

  const visited = new Set<string>();
  let current = start;

  while (current) {
    if (!visited.has(current)) {
      visited.add(current);
    } else {
      throw new Error('Watch comes round again');
    }

    current = links[current];
  }

  return Array.from(visited).reverse();
}
```