You forgot to assign the name to the border sublayer.
if !isAlreadyAdded { border.name = Self.kLayerNameGradientBorder layer.addSublayer(border) }
Please correct the code.