In MySQL, the LIMIT clause does not support named parameters like (:paramName). you should use positional parameters (?N), where N is the position of the argument in the method signature.
eg:
@Query(value = "SELECT q.id FROM question q WHERE q.category = :category ORDER BY RAND() LIMIT ?5", nativeQuery = true)
List<Integer> findRandomQuestionsByCategory(@Param("category") String category, int numQ);