Gradient borders do not exist as a thing in their own right. I can't find a way to have a decent border gradient and a transparent background but if you can compromise one of the following might suffice.
EDIT: I've just noticed your requirement for the gradient to go gold/black/red so option one below is out (but I've kept it because its actually not a bad effect).
#demo {background:#eee;display:flex;gap:10px;}
.circle {
--border-width: 5px;
display:flex; justify-content:center; align-items:center;
position:relative;
width: 200px;
height: 200px;
}
.attempt1 {
border:var(--border-width) solid gold;
border-bottom-style: none;
border-left-style: none;
border-radius: 50%;
background-color: transparent;
}
.attempt1:before {
content: "";
position:absolute;
inset:calc(0px - var(--border-width));
border-radius: 50%;
border:var(--border-width) solid red;
border-top-style: none;
border-right-style: none;
}
.attempt2 {
border:var(--border-width) solid transparent;
border-radius: 50%;
background-color: transparent;
background: linear-gradient(white, white) padding-box,
linear-gradient(45deg, gold, black, red) border-box;
}
<div id="demo">
<div class="circle attempt1">Transparent BG<br>but naff border</div>
<div class="circle attempt2">Solid BG but good border</div>
<div>