Reported by @yifei:luv.asn.au on matrix. In some environments the compiler is not happy with return json(...); when the return type of the function is declared as std::optional<json>. This specifically invokes the std::optional constructor.
Type: fix