I tried with a custom function and to personalize it with another project, it doesn't work...
In this simple case, it works. If not empty, it returns G cells in uppercase :
={"Feature"; ARRAYFORMULA(SI(G2:G="";;IF((NOT(ISEMPTY(G2:G))); UPPERCASE(G2:G); "-")))}
In other case with a custom function, not. It is named "getFeature"
={"Feature"; ARRAYFORMULA(SI(G2:G="";;IF((NOT(ISEMPTY(G2:G))); getFeature(G2:G); "-")))}

When I use it in a classic way, my function works : =getFeature(G7)
Here my custom function :
function getFeature(searchString) {
if (searchString === "") {
return ""
}
var sFeature = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("raw feature")
var rFeatureCol = sFeature.getRange(2, 1, sFeature.getLastRow(), 1)
array = searchString.split(";")
for (let i = 0; i < array.length; i++) {
try {
var textFinder = rFeatureCol.createTextFinder(array[i])
var search_row = textFinder.findNext().getValue()
return array[i]
}
catch {
// erreur détectée
}
}
return ""
}