few things appears to me here:
you need to check that you are dealing with the proper model, that it is already or not extended with the relationController behavior and if so you need to merge the relationConfig instead of adding a new one.
so it looks like this.
note: untested code
\RainLab\Pages\Controllers\Index::extend(function($controller){
if (!$controller->isClassExtendedWith('Backend.Behaviors.RelationController')) {
$controller->implementClassWith(\Backend\Behaviors\RelationController::class);
}
if (!isset($controller->relationConfig)) {
$controller->addDynamicProperty('relationConfig');
}
$controller->mergeConfig('relationConfig', '$/my/cmsblocks/controllers/blocksincmscontroller/config_relation.yaml');
});
Unable to find configuration file relationConfig defined for RainLab\Pages\Controllers\Index.
the config_relation.yaml path is correct.
The merge config will try to find the config A which in this case is not present. Even if you trick october cms and provide a Dummy config.yaml and merge both of them. It results in the same error as Model not found.