Well, you shouldn't use native queries at all unless there's a compelling reason not to use JPQL.
But I suspect that your fault was that you coded "where i.name LIKE %:keyword%" when
you should have coded "where i.name LIKE '%:keyword%'". Note the extra quotes because this is now a
string expression and not a direct variable reference.
Although if I remember correctly. there are some problems with that sort of syntax, so I'm glad you found a solution.
Some people, when well-known sources tell them that fire will burn them, don't put their hands in the fire.
Some people, being skeptical, will put their hands in the fire, get burned, and learn not to put their hands in the fire.
And some people, believing that they know better than well-known sources, will claim it's a lie, put their hands in the fire, and continue to scream it's a lie even as their hands burn down to charred stumps.