Is there any problem if I use get_template_part like this?

Will it cause any problems if I use get_template_part() like this?

I can’t really see any answer other than… no. But that’s based on not knowing what you actually mean by “problems”.

If you mean “is this code totally bulletproof no matter what scenario you could possible throw at it” then yes, it may cause problems – I don’t think you can cover for every eventuality.

But if you mean “am I using the WordPress API in the manner intended/am I doing it right”, then yes, you certainly are.