If you're in an Attachment control, you don't need the $Attachment reference. $URL will suffice.
This:
<% control Attachment %><a href="$URL">Download</a><% end_control %>
and this:
<a href="$Attachment.URL">Download</a>
are the same.
but this:
<% control Attachment %><a href="$Attachment.URL">Download</a><% end_control %>
Is looking for the Attachment property of the Attachment object, which of course, doesn't exist.