It's not necessarily rude, but it is unusual.
Companies usually aren't very flexible about this parameter. They have something specific in mind. If they offered a permanent contract, they want someone who will be there for the long term.
But, you never know until you ask.
You could phrase it something like, "Thank you for your offer. Unfortunately something unavoidable has come up in my future plans which would preclude me from working here after [approximate date], so regretfully I cannot accept it. However, I would still be able to work under a fixed-term contract until then. Would you still be interested?"
I wouldn't, however, be optimistic that they'd agree.
It's also worth considering that, just on a human level, they will probably also be curious about what the future event is, and it would probably be both inadvisable to tell them "I've got a job I like better than this one lined up", and awkward to keep insisting that you can't tell them them what it is.