When using the part for https://dba.stackexchange.com/q/330357/272354: in a question, the trailing colon is discarded.
IMHO it should be obvious that the colon cannot be part of the URL (link), so it should follow the encoded URL link text instead (or at least be part of the URL link text).
This is how that code snippet renders:
for Error "UNIQUE constraint failed" with composite primary key:
<https://dba.stackexchange.com/q/330357/272354>). This doesn't interfere with the magic that replaces bare Stack post URLs with the question title, either.