Material Switch node is behaving weirdly

Hey guys, I just wanted to be sure I did not miss something obvious before reporting a bug, so I’m asking to you guys first.

I’ve been struggling for the past few days with a sudden issue where my material function is triggering multiple nonsense errors outside of my material when I basically plug a scalar parameter on the value pin of a switch node through a scalar input function.

Here are the errors:

LogShaderCompilers: Warning: Failed to compile Material /Engine/Transient.NewMaterial1 for platform PCD3D_SM6, Default Material will be used in game.
Shader debug info dumped to: "C:\Users\akaba\Documents\Unreal Projects\Combat\Saved\ShaderDebugInfo\PCD3D_SM6\NewMaterial1_dc23684579b25847\Default\FLocalVertexFactory\FLumenCardPS\0"
C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,145): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:145: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) *   Local7  +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) *   Local8  +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) *   Local5  +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) *   Local5 ;
                                                                                                                                                       ^
C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,280): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:280: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) *   Local7  +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) *   Local8  +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) *   Local5  +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) *   Local5 ;
                                                                                                                                                                                                                                                                                              ^
C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,415): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:415: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) *   Local7  +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) *   Local8  +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) *   Local5  +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) *   Local5 ;
                                                                                                                                                                                                                                                                                                                                                                                                                                     ^
C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,552): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:552: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) *   Local7  +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) *   Local8  +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) *   Local5  +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) *   Local5 ;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ^
MaterialEditorStats: Error: [SM6] Shader debug info dumped to: "C:\Users\akaba\Documents\Unreal Projects\Combat\Saved\ShaderDebugInfo\PCD3D_SM6\NewMaterial1_dc23684579b25847\Default\FLocalVertexFactory\FLumenCardPS\0"
C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,145): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:145: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) *   Local7  +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) *   Local8  +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) *   Local5  +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) *   Local5 ;
                                                                                                                                                       ^
MaterialEditorStats: Error: [SM6] C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,280): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:280: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) *   Local7  +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) *   Local8  +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) *   Local5  +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) *   Local5 ;
                                                                                                                                                                                                                                                                                              ^
MaterialEditorStats: Error: [SM6] C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,415): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:415: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) *   Local7  +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) *   Local8  +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) *   Local5  +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) *   Local5 ;
                                                                                                                                                                                                                                                                                                                                                                                                                                     ^
MaterialEditorStats: Error: [SM6] C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,552): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:552: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) *   Local7  +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) *   Local8  +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) *   Local5  +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) *   Local5 ;
                                                                                                                                                                                    

And here is the material function:

And here is a simple basic usage to trigger the error:

If I convert the scalar parameter into a constant then everything is working as expected and if I generate a dynamic value for that axis selection it works too. But for some weird reason, I can’t pass a scalar parameter into that function… The most crazy thing here is that if I use that same scalar parameter directly inside the material function instead of a scalar input, then everything works fine too.

So what do you guys think about this, is it a bug or just me doing crappy things?