# Koma scrbook chapter customization destroys my table of contents and sections

I have the following document

\documentclass[chapterprefix=true]{scrbook}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{blindtext}
\colorlet{chaptercolor}{black}

\setkomafont{chapter}{\normalfont\color{chaptercolor}\Huge}
\setkomafont{chapterprefix}{\Large}
\renewcommand*{\raggedchapter}{\raggedleft}
\renewcommand*{\chapterformat}{%
\MakeUppercase{\chapappifchapterprefix{}}%
\rlap{\enskip\resizebox{!}{1.2cm}{\thechapter} \rule{15cm}{1.2cm} }%
}

\RedeclareSectionCommand[beforeskip=30pt,afterskip=20pt]{chapter}

\begin{document}
\tableofcontents
\chapter{Amazing 1}
\blindtext
\section{Amazing 2}
\end{document}


I am very happy with the chapter design as it is, but when using the above code the table of contents looks really strange. The font seems to be different and it is neither as bold nor as big as chapters usually are. The same is true for the design of sections, subsections etc.

How can I only change the chapters appearance without changing the appearance of the toc and other sections?

If I run the MWE in the question I get a different result:

Note that the section heading and the chapter entry in ToC are bold and sans serif.

I am not sure if I understood how the desired result look like. Assuming unnumbered chapters like TOC should get the default font without customization:

\documentclass[chapterprefix=true]{scrbook}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{blindtext}
\colorlet{chaptercolor}{black}

\newkomafont{chapterwithprefix}{\normalfont\Huge\color{chaptercolor}}
\setkomafont{chapterprefix}{\Large}
\renewcommand*{\raggedchapter}{\raggedleft}
\renewcommand*{\chapterformat}{%
\MakeUppercase{\chapappifchapterprefix{}}%
\rlap{\enskip\resizebox{!}{1.2cm}{\thechapter} \rule{15cm}{1.2cm} }%
}

\RedeclareSectionCommand[beforeskip=30pt,afterskip=20pt,innerskip=10pt]{chapter}
\renewcommand\chapterlineswithprefixformat[3]{%
\ifstr{#1}{chapter}
{\IfArgIsEmpty{#2}{}{\usekomafont{chapterwithprefix}}#2#3}
{#2#3}%
}

\begin{document}
\tableofcontents
\chapter{Amazing 1}
\blindtext
\section{Amazing 2}
\end{document}