Whenever a solution is not provided, XSIM is repeating the statement of the exercise as its solution. This only happens for custom exercise types. In the example below, it should not show the "hint for task 2".
\documentclass{article}
\usepackage{xsim}
\DeclareExerciseType{task}{
exercise-env = task ,
solution-env = taskhint ,
exercise-name = Task ,
solution-name = Hint for task ,
exercise-template = default ,
solution-template = default
}
\begin{document}
\section*{Tasks}
\begin{task}
Statement of task 1.
\end{task}
\begin{taskhint}
Hint for task 1.
\end{taskhint}
\begin{task}
Statement of task 2.
\end{task}
\begin{task}
Statement of task 3.
\end{task}
\begin{taskhint}
Hint for task 3.
\end{taskhint}
\section*{Hints}
\printallsolutions
\end{document}

xsim.sty 2022/02/12 v0.21– Simon Dispa Nov 22 '22 at 19:23"This is LuaHBTeX, Version 1.14.0 (TeX Live 2022/dev/Debian) (format=lualatex 2022.11.17) 22 NOV 2022 16:42 Package: xsim 2021/02/03 v0.20c eXercise Sheets IMproved"
– Leonardo Castro Nov 22 '22 at 19:53