[SOLVED] Cannot check "image number" of "closest instance of (sprite-type) to (sprite), error message comes out

I am making a DNA repair game, I am trying to check if the base pair you clicked is mutated or not.
to do this I want to check the “clicked component” and the image number of the closest DNA_type (the complementary base), but as soon as I put this in an “if” or “set variable” block an error message pops up ---->“Internal error generating code for blocks”

this is the game Thunkable

this is the problematic code

what can I do to avoid this bug? Maybe some alternative method for getting the value.
Thanks in advance.

P.S the ± 1 in the “if” is because the image number of pairs is either the one after or before, I put 2 unused images between pairs so they wouldn’t clash, I use the “is even” to know which one to generate.
1=A
2=T
3=UNUSED
4=UNUSED
5=G
6=C

I’m not sure why that’s giving an error but you can often get around those type mismatches by assigning the offending value to a variable and then using that variable to complete the sequence of blocks, like this:

Yeah, this solved it. Still If I had a nickel for every bug with block interactions this week, I’d have 2 nickels, which isn’t alot but it’s weird that it happened twice.