The format string must be a constant expression, see
std::format - cppreference.com[
^].
[edit]
I have been looking at the documentation (per the above link), and trying some tests. Even using the string:
const char* fmt = "{}";
produces the same errors, so it would appear that the template only accepts an actual string constant as the format string.
[/edit]