You are not seeing an error; the practice of adding an AS number multiple times is called AS Path Prepending (see "Traffic Engineering via Prepending").
One of the criteria that eBGP uses in its best-path selection algorithm is AS-Path-length. In many cases, BGP selects a path paths based on the shortest AS path, therefore AS Path prepending makes those announcements less preferred than announcements that were not prepended.
Some multi-homed eBGP autonomous systems use AS path prepending for traffic-engineering.
As an FYI, this is a short summary of the Cisco IOS BGP Path Selection algorithm (summarized from the hyperlink above)...
- Highest weight (a vendor-specific bgp parameter)
- Highest local-preference
- Prefer if the prefix was locally-originated by the router via a
network
or aggregate
BGP subcommand, or through redistribution from an IGP like OSPF or ISIS.
- Prefer the path with shortest AS-Path length. <--- the decision point I mentioned above.
- Prefer the path with the lowest origin type.
- Prefer the path with the lowest multi-exit discriminator (MED).
- Prefer eBGP over iBGP paths.
- Prefer the path with the lowest IGP metric to the BGP next hop.
- Consider whether multiple paths should be installed (i.e. BGP Multipath)
- When both paths are external, prefer the path that was received first (the oldest one).