Upgrade `thiserror` to `2`
This commit upgrades the thiserror
crate to version 2
across the entire project.
It also includes a fix for the only place in the code, where the breaking change affected us.
Please keep philosophical discussions to #1741 (closed), so that this MR remains technical only.