What are the actual values in each of those array elements?
It seems like MEL determines the data type of its array constants based on the first value in the array. Well, at least this is the behavior I've observed... Here's some examples...
// This works as expected...
float $a[] = {4.5, 1, 2, 3};
// This one returns some errors, even though the data elements are the same but just in a
// different order. In this example, MEL doesn't automatically cast properly because it determines
// the whole array constant is of type int[] simply because the first element is an int...
float $b[] = {1, 2, 3, 4.5};
// Warning: float $b[] = {1, 2, 3, 4.5}; ; //
// Warning: Line 1.27 : Casting from float to int may result in a loss of precision. //
// This works fine...
string $c[] = {"hello", "world", 42};
// Again, same elements but in a different order produces vastly different results because MEL
// seems to determine the type of the array constant based on its first value and then
// attemps to cast the remaining values of the array based on that assumption.
string $d[] = {42, "hello", "world"};
// Warning: string $d[] = {42, "hello", "world"}; //
// Warning: Line 1.36 : Converting string "hello" to an int value of 0. //
// Warning: string $d[] = {42, "hello", "world"}; //
// Warning: Line 1.36 : Converting string "world" to an int value of 0. //
// Error: string $d[] = {42, "hello", "world"}; //
// Error: Line 1.37: Cannot cast data of type int[] to string[]. //
Maybe your issue is related to this? That is why I asked what values where in each of the variables passed to the return statement.
Also, does it help if you put parens around the array when you return it? ex:
return ( {"V", $oppositeVert, $edgesToCheck[0], $edgesToCheck[1]} );