But if I add more blocks in the future, it won’t make problems?
No, it won’t.
The better solution would be adding additional CSS classes to the GB containers, eg. for the related post container- related-posts and for related pages container – related-pages, then we can target them using these classes.
https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/
The CSS would be:
.page .inside-right-sidebar > .gb-container.related-pages {
order: 3;
}
.page .inside-right-sidebar > .gb-container.related-posts {
order: 4;
}
.page .inside-right-sidebar {
display: flex;
flex-direction: column;
}