Turning that into something a bit more readable:
SELECT question bankentryid, MAX(version) AS latest version FROM mdl_question versions WHERE questionbankentryid IN (?,?,?,?,?,?,?) GROUP BY questionbankentryid
-- line 1611 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
-- line 159 of /question/type/questionbase.php: call to core_question\output\question_version_info::populate_latest_versions()
-- line 63 of /question/classes/output/question_version_info.php: call to question_definition->__get()
-- line 268 of /question/bank/previewquestion/preview.php: call to core_question\output\question_version_info->__construct() [array ( 0 => NULL, 1 => NULL, 2 => NULL, 3 => NULL, 4 => NULL, 5 => NULL, 6 => '1713497', )]
Error code: dmlreadexception×Descartar esta notificación Trazado de la pila (stack): line 497 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
line 1364 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
line 1611 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
line 83 of /question/classes/output/question_version_info.php: call to moodle_database->get_records_sql_menu()
line 159 of /question/type/questionbase.php: call to core_question\output\question_version_info::populate_latest_versions() line 63 of /question/classes/output/question_version_info.php: call to question_definition->__get()
line 268 of /question/bank/previewquestion/preview.php: call to core_question\output\question_version_info->__construct() moodle
That does not look like the complete error message. You have included a lot of the useful information, but it looks like you have left of the actual error message bit which I wuodl expect to see at the start of that. Something like "Unknow column question" or something.
Acutally, the space in the middle of 'question bankentryid' looks suspicious to me. It should not be there: https://github.com/moodle/moodle/blob/ab8a4dd8cb1689f2e20a67b8c6dc5675d04d1f9d/question/classes/output/question_version_info.php#L74 Is that just a copy-paste error?