This is another case in which a previous biblatex code no longer performs the desired function due to changes in biber/biblatex.
When running the code from Commas in biblatex entries, which itself is an update from Placement of Jr. and Sr. with biblatex, the words Jr. and Sr. are no longer placed after the person's name in the reference list. I'm running biblatex verson 3.11 with biber version 2.11.
\documentclass{article}
\usepackage[style = authoryear-comp]{biblatex}
\renewbibmacro*{name:last-first}[4]{%
\ifuseprefix
{\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\ifblank{#3}{}{%
\ifcapital
{\mkbibnameprefix{\MakeCapital{#3}}\isdot}
{\mkbibnameprefix{#3}\isdot}%
\ifpunctmark{'}{}{\bibnamedelimc}}%
\mkbibnamelast{#1}\isdot
\ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamefirst{#2}\isdot}%
\ifblank{#4}{}{\revsdnamepunct\bibnamedelimd\mkbibnameaffix{#4}\isdot}}
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibnamelast{#1}\isdot
\ifblank{#2#3}{}{\revsdnamepunct}%
\ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{#2}\isdot}%
\ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}%
\ifblank{#4}{}{\revsdnamepunct\bibnamedelimd\mkbibnameaffix{#4}\isdot}}}
\DeclareStyleSourcemap{
\maps[datatype = bibtex]{
\map{%% Make sure a field like [Adam John Smith] comes out as [Smith, Adam John]
\step[fieldsource = author,
match = \regexp{\A\[(.+)\s+([^\s]+)\]\Z},
replace = {[$2, $1]}]
}
\map{%% Abbreviate an entry such as Adam J[ohn] Smith to Smith, Adam J.
\step[fieldsource = author,
match = \regexp{(\w+)\[(.+?)\]},
replace ={$1.}]
}
\map{%% Abbreviate an entry such as [Adam John] Smith to Smith
\step[fieldsource = author,
notmatch = \regexp{\A\[(.+)\]\Z},
final]
\step[fieldsource = author,
match = \regexp{(\A|\,\s)\[(.+?)\]},
replace = {$1}]
}
}
}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@BOOK{lennon1970,
AUTHOR = "J[ohn] Lennon",
TITLE = "My life with the Beatles",
YEAR = "1970",
SORTNAME = "John Lennon"}
@BOOK{lennon1971,
AUTHOR = "[John Lennon]",
TITLE = "Moving on",
YEAR = "1971",
SORTNAME = "John Lennon"}
@BOOK{lennon1972,
AUTHOR = "[J. John Lennon]",
TITLE = "Moving further on",
YEAR = "1972",
SORTNAME = "John Lennon"}
@BOOK{lennon1973,
AUTHOR = "John Lennon",
TITLE = "Still moving on",
YEAR = "1973",
SORTNAME = "John Lennon"}
@BOOK{lennon1974,
AUTHOR = "[John] Lennon",
TITLE = "I'm out of here",
YEAR = "1974",
SORTNAME = "John Lennon"}
@BOOK{lennon1975,
AUTHOR = "Lennon, [John]",
TITLE = "I'm out of here",
YEAR = "1975",
SORTNAME = "John Lennon"}
@BOOK{beatles1970,
AUTHOR = "John W[inston] Lennon and J[ames] Paul McCartney",
TITLE = "Let it be",
YEAR = "1970"}
@BOOK{gauch2012,
AUTHOR = "Gauch, Jr., Hugh G.",
TITLE = "Scientific method in brief",
YEAR = "2012",
LOCATION = "Cambridge",
PUBLISHER = "Cambridge University Press"}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}

