The JS documentation for getMessagesByMessageId (GroupChannel - Documentation and https://sendbird.com/docs/chat/v3/javascript/guides/group-channel#2-load-previous-messages) specify that the argument order is messageId, then params.
This contradicts with TypeScript declaration files which specify:
getMessagesByMessageId(params: MessageListParams, messageId: number, callback?: messageListCallback): Promise<Array<UserMessage | FileMessage | AdminMessage>>;